master^2
Bhaskar 8 months ago
parent a64d533e80
commit 83af35801b

@ -741,9 +741,9 @@ fastify.register(require('fastify-multipart'));
// }
// });
fastify.post('/api/uploads_team_member/:departmentId', async (request, reply) => {
fastify.post('/api/uploads_team_member/:customerId', async (request, reply) => {
try {
const departmentId = request.params.departmentId;
const customerId = request.params.customerId;
const data = await request.file();
// Generate a unique file name
@ -767,7 +767,7 @@ fastify.post('/api/uploads_team_member/:departmentId', async (request, reply) =>
const publicUrl = `https://storage.googleapis.com/${bucketName}/${filePath}`;
TeamMemberProfilePicture.findOneAndUpdate(
{ departmentId },
{ customerId },
{ picture: publicUrl },
{ new: true, upsert: true },
(error, picture) => {

@ -119,7 +119,7 @@ const citySchema = new mongoose.Schema(
);
const teamMemberProfilePictureSchema = new Schema({
departmentId: {
customerId: {
type: String,
unique: true,
required: true

Loading…
Cancel
Save