profilepicture file format

master
Bhaskara Kishore 2 years ago
parent 2284eacec1
commit f890d25cf9

@ -114,18 +114,37 @@ 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: String,
required: true
type: {
type: String,
enum: ['jpeg', 'png', 'gif'], // add the file formats you support here
required: true
},
data: {
type: Buffer,
required: true
}
}
});
const ProfilePicture = mongoose.model('ProfilePicture', profilePictureSchema);
const Counter = mongoose.model('Counter', CounterSchema);
const User = mongoose.model("User", userSchema);

@ -454,15 +454,35 @@ module.exports = function (fastify, opts, next) {
},
},
},
// body: {
// type: "object",
// required: ["picture"],
// properties: {
// picture: {
// type: 'string'
// }
// },
// },
body: {
type: "object",
required: ["picture"],
properties: {
picture: {
type: 'string'
type: "object",
properties: {
type: {
type: "string",
enum: ['jpeg', 'png', 'gif']
},
data: {
type: "string",
format: "binary"
}
}
}
},
},
security: [
{
basicAuth: [],

Loading…
Cancel
Save