From 6be95bc55da7ecfc216aad511c9ed2340e0e406d Mon Sep 17 00:00:00 2001 From: Bhaskar Date: Wed, 17 Sep 2025 12:30:00 +0530 Subject: [PATCH] teammember picture installation --- src/index.js | 11 ++++++----- src/models/store.js | 5 +++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/index.js b/src/index.js index 9fa69d76..4a657e28 100644 --- a/src/index.js +++ b/src/index.js @@ -1271,11 +1271,12 @@ fastify.post("/api/uploads_installation_TeamMember_profile/:installationId/:team const publicUrl = `https://storage.googleapis.com/${bucketName}/${filePath}`; // Always upsert the installation-level picture doc - await ProfilePictureInstall.findOneAndUpdate( - { installationId }, - { picture: publicUrl }, - { new: true, upsert: true } - ); + await ProfilePictureInstallTeamMember.findOneAndUpdate( + { installationId, teamMemberId }, + { picture: publicUrl }, + { new: true, upsert: true } +); + // Update department picture where departmentId === installationId const deptUpdate = await Deparments.findOneAndUpdate( diff --git a/src/models/store.js b/src/models/store.js index 2650e7d4..a498237e 100644 --- a/src/models/store.js +++ b/src/models/store.js @@ -258,6 +258,11 @@ const installationschema = new mongoose.Schema({ }); const profilePictureInstallTeamMemberSchema = new Schema({ + installationId: { + type: String, + unique: true, + required: true + }, teamMemberId: { type: String, unique: true,