|
|
|
@ -32,7 +32,7 @@ const generateTeamMemberId = async () => {
|
|
|
|
|
exports.createTeamMember = async (req, reply) => {
|
|
|
|
|
try {
|
|
|
|
|
const { adminId } = req.params;
|
|
|
|
|
const { departmentId, departmentName, firstName, phone, password, email, alternativePhone, status } = req.body;
|
|
|
|
|
const { departmentId, departmentName, firstName, phone, password, email, alternativePhone, status ,officeName,city} = req.body;
|
|
|
|
|
|
|
|
|
|
if (!adminId) {
|
|
|
|
|
return reply.status(400).send({ simplydata: { error: true, message: "adminId is required in path params" } });
|
|
|
|
@ -78,6 +78,7 @@ exports.createTeamMember = async (req, reply) => {
|
|
|
|
|
departmentName,
|
|
|
|
|
password: hashedPassword,
|
|
|
|
|
status: status || "active",
|
|
|
|
|
officeName,city
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Add to team_member array
|
|
|
|
@ -427,6 +428,7 @@ exports.getTeamMembers = async (request, reply) => {
|
|
|
|
|
departmentName
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!department) {
|
|
|
|
|
return reply.status(404).send({
|
|
|
|
|
simplydata: {
|
|
|
|
|