ashok 2 weeks ago
commit ded08b70c8

@ -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(

@ -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,

Loading…
Cancel
Save