Skip to content

Commit

Permalink
remove token in generate pdf
Browse files Browse the repository at this point in the history
  • Loading branch information
arvind9140 committed May 1, 2024
1 parent 12e0458 commit 598ae80
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 52 deletions.
1 change: 0 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export const getleadData = async(req,res)=>{

let files = []
for (let i = 0; i < data[0].files.length; i++) {
console.log(data[0].files[i])

if(data[0].files[i].files.length>0)
{
files.push({
Expand Down
4 changes: 2 additions & 2 deletions controllers/adminControllers/momControllers/mom.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,8 @@ export const generatePdf = async (req, res) => {

export const sendPdf = async (req, res) => {
try {
const project_id = req.query.project_id;
const mom_id = req.query.mom_id;
const project_id = req.body.project_id;
const mom_id = req.body.mom_id;

const check_project = await projectModel.find({ project_id: project_id });

Expand Down
96 changes: 48 additions & 48 deletions routes/adminRoutes/adminroutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
} from "../../controllers/adminControllers/projectController/project.controller.js";
import {
getQuotationData,

} from "../../controllers/adminControllers/quotationController/getQuotation.controller.js";

import { contractShare } from "../../controllers/adminControllers/fileUploadController/contract.controller.js";
Expand All @@ -47,60 +47,60 @@ import { verifyJWT } from "../../middlewares/auth.middlewares.js";
import { contractStatus, getContractData, shareContract } from "../../controllers/adminControllers/fileUploadController/contract.share.controller.js";
import { AddMemberInLead } from "../../controllers/adminControllers/leadController/addmemberinlead.controller.js";
// router.use(checkAvailableUserIsAdmin)
router.use(verifyJWT)

router.route("/create/user").post(isAdmin, createUser);
router.route("/add/member").post(isAdmin, addMember);
router.route("/get/alluser").get(getUser);
router.route("/delete/user").delete(isAdmin, deleteUser);


router.route("/fileupload").post(fileupload);
router.route("/getfile").get(checkAvailableUserIsAdmin, getFileData);
router.route("/get/onefile").get(getSingleFileData);
router.route("/lead/getfile").get(getleadData);
router.route("/project/getfile").get(getprojectData);
router.route("/project/fileupload").post(projectFileUpload);
router.route("/view/contract").post(contractShare);
router.route("/share/file").post(shareFile);
router.route("/template/fileupload").post(templateFileUpload);
router.route("/template/single/file").get(getSingleTemplateFile);
router.route("/delete/file").delete(deleteFile);
router.route("/share/contract").post(shareContract);
router.route("/contract/approval").post(contractStatus);
router.route("/get/contractdata").get(getContractData);
router.route("/delete/folder").delete(deleteFolder);



router.route("/getall/project").get(checkAvailableUserIsAdmin, getAllProject);
router.route("/getsingle/project").get(getSingleProject);
router.route("/update/project").put(updateProjectDetails);

router.route("/create/lead").post(isAdmin, createLead);
router.route("/getall/lead").get(isAdmin, getAllLead);
router.route("/getsingle/lead").get(isAdmin, getSingleLead);
router.route("/update/lead").put(isAdmin, updateLead);
router.route("/create/lead/project").post(isAdmin, leadToProject);
router.route("/add/member/lead").post(isAdmin, AddMemberInLead);

router.route("/create/mom").post(createmom);
router.route("/getall/mom").get(getAllMom);
router.route("/getsingle/mom").get(getSingleMom);


router.route("/create/user").post(verifyJWT, isAdmin, createUser);
router.route("/add/member").post(verifyJWT, isAdmin, addMember);
router.route("/get/alluser").get(verifyJWT, getUser);
router.route("/delete/user").delete(verifyJWT, isAdmin, deleteUser);


router.route("/fileupload").post(verifyJWT, fileupload);
router.route("/getfile").get(verifyJWT, checkAvailableUserIsAdmin, getFileData);
router.route("/get/onefile").get(verifyJWT, getSingleFileData);
router.route("/lead/getfile").get(verifyJWT, getleadData);
router.route("/project/getfile").get(verifyJWT, getprojectData);
router.route("/project/fileupload").post(verifyJWT, projectFileUpload);
router.route("/view/contract").post(verifyJWT, contractShare);
router.route("/share/file").post(verifyJWT, shareFile);
router.route("/template/fileupload").post(verifyJWT, templateFileUpload);
router.route("/template/single/file").get(verifyJWT, getSingleTemplateFile);
router.route("/delete/file").delete(verifyJWT, deleteFile);
router.route("/share/contract").post(verifyJWT, shareContract);
router.route("/contract/approval").post(verifyJWT, contractStatus);
router.route("/get/contractdata").get(verifyJWT, getContractData);
router.route("/delete/folder").delete(verifyJWT, deleteFolder);



router.route("/getall/project").get(verifyJWT, checkAvailableUserIsAdmin, getAllProject);
router.route("/getsingle/project").get(verifyJWT, getSingleProject);
router.route("/update/project").put(verifyJWT, updateProjectDetails);

router.route("/create/lead").post(verifyJWT, isAdmin, createLead);
router.route("/getall/lead").get(verifyJWT, isAdmin, getAllLead);
router.route("/getsingle/lead").get(verifyJWT, isAdmin, getSingleLead);
router.route("/update/lead").put(verifyJWT, isAdmin, updateLead);
router.route("/create/lead/project").post(verifyJWT, isAdmin, leadToProject);
router.route("/add/member/lead").post(verifyJWT, isAdmin, AddMemberInLead);

router.route("/create/mom").post(verifyJWT, createmom);
router.route("/getall/mom").get(verifyJWT, getAllMom);
router.route("/getsingle/mom").get(verifyJWT, getSingleMom);
router.route("/generate/pdf").get(generatePdf);
router.route("/getall/project/mom").get(checkAvailableUserIsAdmin, getAllProjectMom);
router.route("/send/momdata").get(sendPdf);
router.route("/getall/project/mom").get(verifyJWT, checkAvailableUserIsAdmin, getAllProjectMom);
router.route("/send/momdata").get(verifyJWT, sendPdf);


router.route("/share/quotation").post(shareQuotation);
router.route("/get/quotationdata").get(getQuotationData);
router.route("/quotation/approval").post(updateStatusAdmin);
router.route("/share/quotation").post(verifyJWT, shareQuotation);
router.route("/get/quotationdata").get(verifyJWT, getQuotationData);
router.route("/quotation/approval").post(verifyJWT, updateStatusAdmin);




router.route("/get/notification").get(checkAvailableUserIsAdmin, getNotification);
router.route("/update/notification").put(updateNotification);
router.route("/get/notification").get(verifyJWT, checkAvailableUserIsAdmin, getNotification);
router.route("/update/notification").put(verifyJWT, updateNotification);



Expand Down

0 comments on commit 598ae80

Please sign in to comment.