update the tank dimensions based on teammebr

master^2
Bhaskar 3 months ago
parent 0da6e85ce8
commit 06736a6e5f

@ -3168,6 +3168,16 @@ exports.editTankDimensions = async (req, reply) => {
});
}
const teamMemberDetails = installRecord.team_member?.team_member?.find(
member => member.teamMemberId === teamMemberId
) || null;
if (!teamMemberDetails) {
return reply.code(404).send({
success: false,
message: 'Team member details not found under install record'
});
}
// Step 2: Find the matching order using installationId from install and customerId
const orderRecord = await Order.findOne({
installationId: installRecord.installationId,
@ -3204,7 +3214,16 @@ exports.editTankDimensions = async (req, reply) => {
return reply.send({
success: true,
message: 'Tank dimensions updated successfully',
updatedTank
updatedTank,
teamMember: {
teamMemberId: teamMemberDetails.teamMemberId,
firstName: teamMemberDetails.firstName,
phone: teamMemberDetails.phone,
email: teamMemberDetails.email,
alternativePhone: teamMemberDetails.alternativePhone,
installationTeamMemId: teamMemberDetails.installationTeamMemId,
status: teamMemberDetails.status
}
});
} catch (error) {

Loading…
Cancel
Save