master^2
Varun 8 months ago
parent 25be89d52c
commit 38eafcbad7

@ -938,6 +938,7 @@ exports.createstaff = async (request, reply) => {
return reply.status(400).send({ error: 'Duplicate phone numbers found', duplicatePhones }); return reply.status(400).send({ error: 'Duplicate phone numbers found', duplicatePhones });
} }
// Update the user document with the new staff members // Update the user document with the new staff members
user.staff.staff.push(...newStaff); user.staff.staff.push(...newStaff);

@ -63,6 +63,7 @@ const userSchema = new mongoose.Schema(
survey_status:{ type:String,default: "pending" }, survey_status:{ type:String,default: "pending" },
staff: { staff: {
staff: [ staff: [
{ {
name: { type: String }, name: { type: String },

@ -865,6 +865,7 @@ module.exports = function (fastify, opts, next) {
}, },
], ],
}, },
//preHandler: fastify.auth([fastify.authenticate]), //preHandler: fastify.auth([fastify.authenticate]),
handler: userController.createstaff, handler: userController.createstaff,
}); });

Loading…
Cancel
Save