Skip to content

Commit

Permalink
BATM is fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Hemu21 committed May 13, 2024
1 parent 524cddc commit 13fc721
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 8 deletions.
8 changes: 8 additions & 0 deletions backend/app/routes/faq/updateFaq.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/* eslint-disable no-shadow */
/* eslint-disable prefer-arrow-callback */
/* eslint-disable prefer-destructuring */
/* eslint-disable prefer-const */
/* eslint-disable consistent-return */
/* eslint-disable no-unused-vars */
/* eslint-disable prettier/prettier */
const FAQ = require('../../models/faq');

module.exports = async(req,res,next) => {
Expand All @@ -7,6 +14,7 @@ module.exports = async(req,res,next) => {
if(faq == null) {
return res.json({message:"invalid id"});
}

const updatedFaq = {question:req.body.question,answer:req.body.answer,isActive:req.body.isActive,tags:req.body.tags};
FAQ.findByIdAndUpdate(faqId,{$set:updatedFaq},{new:true},function(err,faq) {
if (err) return res.status(500).send({error: err});
Expand Down
8 changes: 8 additions & 0 deletions backend/app/routes/joinUs/deleteJoinUs.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/* eslint-disable import/newline-after-import */
/* eslint-disable no-shadow */
/* eslint-disable prefer-arrow-callback */
/* eslint-disable prefer-destructuring */
/* eslint-disable prefer-const */
/* eslint-disable consistent-return */
/* eslint-disable no-unused-vars */
/* eslint-disable prettier/prettier */
const joinUsModel = require('../../models/joinUs');
module.exports = async(req,res,next) => {
try {
Expand Down
15 changes: 7 additions & 8 deletions backend/app/routes/teamMember/addTeam.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ module.exports = async (req, res, next) => {
res.status(401).json({ error: 'You are not an admin' });
}

const { fullName, description, linkedlinUrl, githubUrl, twitterUrl, teams } = req.body;
const teammember = new TeamMemberModel({
full_name: fullName,
image: req.file.path,
description,
linkedlin_url: linkedlinUrl,
github_url: githubUrl,
twitter_url: twitterUrl,
teams,
full_name: req.body?.full_name,
image: req.body?.image,
description: req.body?.description,
linkedin_url: req.body?.linkedin_url,
github_url: req.body?.github_url,
twitter_url: req.body?.twitter_url,
teams: req.body?.teams,
});

const [err, result] = await to(teammember.save());
Expand Down
8 changes: 8 additions & 0 deletions backend/app/routes/teamMember/deleteTeamMember.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/* eslint-disable import/newline-after-import */
/* eslint-disable no-shadow */
/* eslint-disable prefer-arrow-callback */
/* eslint-disable prefer-destructuring */
/* eslint-disable prefer-const */
/* eslint-disable consistent-return */
/* eslint-disable no-unused-vars */
/* eslint-disable prettier/prettier */
const teamMemberModel = require('../../models/TeamMember');
module.exports = async(req,res,next) => {
try {
Expand Down

0 comments on commit 13fc721

Please sign in to comment.