Varun 8 months ago
commit d189c5921b

@ -475,6 +475,7 @@ exports.addDepartment = async (request, reply) => {
pincode, pincode,
desginationName, desginationName,
location, location,
picture,
createdBy, createdBy,
updatedBy, updatedBy,
} = request.body; } = request.body;
@ -517,6 +518,7 @@ exports.addDepartment = async (request, reply) => {
pincode, pincode,
desginationName, desginationName,
location, location,
picture,
createdBy, createdBy,
updatedBy, updatedBy,
}); });

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

@ -98,6 +98,7 @@ const citySchema = new mongoose.Schema(
personal_city: { type: String }, personal_city: { type: String },
state: String, state: String,
country: String, country: String,
picture:{type:String},
services: { password: { bcrypt: String } }, services: { password: { bcrypt: String } },
createdAt: { createdAt: {
type: Date, type: Date,
@ -138,7 +139,7 @@ const citySchema = new mongoose.Schema(
}); });
const companyProfilePictureSchema = new Schema({ const companyProfilePictureSchema = new Schema({
cityId: { customerId: {
type: String, type: String,
unique: true, unique: true,
required: true required: true

@ -204,6 +204,7 @@ module.exports = function (fastify, opts, next) {
officeName: { type: "string"}, officeName: { type: "string"},
reportingManager_mobile_number: { type: "string"}, reportingManager_mobile_number: { type: "string"},
reportingManager_email: { type: "string"}, reportingManager_email: { type: "string"},
picture: { type: "string"},
location: { location: {
type: "array", type: "array",
items: { type: "string" }, items: { type: "string" },

Loading…
Cancel
Save