/
home
/
infinitibizsol
/
.trash
/
node_modules.8
/
.cache
/
esm
/
File Upload :
llllll
Current File: /home/infinitibizsol/.trash/node_modules.8/.cache/esm/374e2c035eda8126.js
let db,AppError,catchAsync,successResponse;_5ed.x([["default",()=>_5ed.o]]);_5ed.w("../../model/index",[["default",["db"],function(v){db=v}]]);_5ed.w("../../utils/apiError",[["default",["AppError"],function(v){AppError=v}]]);_5ed.w("../../utils/catchAsync",[["default",["catchAsync"],function(v){catchAsync=v}]]);_5ed.w("../../utils/responseFormat",[["successResponse",["successResponse"],function(v){successResponse=v}]]); const index = catchAsync(async (req, res, next) => { const query = req.query; let allData = await db.AdditionalInterest.find(query); return successResponse(res, allData); }); const add = catchAsync(async (req, res, next) => { const additionalInterest = new db.AdditionalInterest(req.body); await additionalInterest.save(); return successResponse( res, additionalInterest, "AdditionalInterest saved successfully" ); }); const edit = catchAsync(async (req, res, next) => { let result = await db.AdditionalInterest.findByIdAndUpdate( { _id: req.params.id }, { $set: req.body }, { new: true } ); if (!result) { return next(new AppError("No data found.", 404)); } return successResponse( res, result, "AdditionalInterest updated successfully" ); }); const deleteData = catchAsync(async (req, res, next) => { let additionalInterest = await db.AdditionalInterest.findByIdAndDelete({ _id: req.params.id, }); if (!additionalInterest) { return next(new AppError("No data found.", 404)); } return successResponse( res, additionalInterest, "AdditionalInterest deleted successfully" ); }); _5ed.d({ index, add, edit, deleteData });
Copyright ©2k19 -
Hexid
|
Tex7ure