diff --git a/src/models/User.js b/src/models/User.js index 2e536c89..fc6f6c06 100644 --- a/src/models/User.js +++ b/src/models/User.js @@ -114,37 +114,18 @@ const userSchema = new mongoose.Schema( { versionKey: false } ); -// const profilePictureSchema = new Schema({ -// customerId: { -// type: String,unique: true, -// required: true -// }, -// picture: { -// type: String, -// required: true -// } -// }); const profilePictureSchema = new Schema({ customerId: { - type: String, - unique: true, + type: String,unique: true, required: true }, picture: { - type: { - type: String, - enum: ['jpeg', 'png', 'gif'], // add the file formats you support here - required: true - }, - data: { - type: Buffer, - required: true - } + type: String, + required: true } }); - const ProfilePicture = mongoose.model('ProfilePicture', profilePictureSchema); const Counter = mongoose.model('Counter', CounterSchema); const User = mongoose.model("User", userSchema); diff --git a/src/routes/usersRoute.js b/src/routes/usersRoute.js index 43b0552d..fba890dc 100644 --- a/src/routes/usersRoute.js +++ b/src/routes/usersRoute.js @@ -454,35 +454,15 @@ module.exports = function (fastify, opts, next) { }, }, }, - // body: { - // type: "object", - // required: ["picture"], - // properties: { - // picture: { - // type: 'string' - // } - // }, - // }, body: { type: "object", required: ["picture"], properties: { picture: { - type: "object", - properties: { - type: { - type: "string", - enum: ['jpeg', 'png', 'gif'] - }, - data: { - type: "string", - format: "binary" - } - } + type: 'string' } }, }, - security: [ { basicAuth: [],