Skip to content

Commit

Permalink
made changes to getformformatFunction
Browse files Browse the repository at this point in the history
  • Loading branch information
JatinAgrawal94 committed Oct 31, 2024
1 parent a86b33d commit f7817df
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/controllers/formController.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ const formController = function (Form,formResponse) {

const deleteFormFormat = async function(req,res){
try {
const {formID}=req.body;
let result=await Form.deleteOne({ _id : formID});
// here id is the record Id of the form.
const {id}=req.body;
let result=await Form.deleteOne({ _id : id});
// Check if the form was actually deleted
if (result.deletedCount === 0) {
return res.status(400).json({ message: 'Error removing Form.' });
Expand Down

0 comments on commit f7817df

Please sign in to comment.