|
|
|
@ -968,6 +968,7 @@ exports.editStaff = async (request, reply) => {
|
|
|
|
|
const staffMember = user.staff.staff.find(member => member.phone === phone);
|
|
|
|
|
staffMember.name = name || staffMember.name;
|
|
|
|
|
staffMember.password = password || staffMember.password;
|
|
|
|
|
staffMember.all_motor_access = all_motor_access || staffMember.all_motor_access;
|
|
|
|
|
|
|
|
|
|
await user.save();
|
|
|
|
|
reply.send({ message: 'Staff member updated successfully', staff: staffMember });
|
|
|
|
|