ADD: API_URL to env
ADD: DocumentUrls and mainImageUrls field in belonging model FIX: Indexing bugs for belonging ADD: getImage endpoint to get private images ADD: PrivateUrl field as virtual FIX: Minor bug in bucketDeleteFile service ADD: Word type to multer file checker
This commit is contained in:
@@ -35,10 +35,8 @@ const belongingSchema = new mongoose.Schema(
|
||||
required: false,
|
||||
},
|
||||
},
|
||||
documentNames: [String],
|
||||
imageNames: [String],
|
||||
mainImageNames: [String],
|
||||
mainImageUrl: String,
|
||||
documentUrls: [String],
|
||||
mainImageUrls: [String],
|
||||
tags: [String],
|
||||
isActive: {
|
||||
type: Boolean,
|
||||
@@ -66,15 +64,11 @@ const belongingSchema = new mongoose.Schema(
|
||||
belongingSchema.plugin(AutoIncrement, { inc_field: 'belongingCode' })
|
||||
|
||||
belongingSchema.methods.getDocumentsSignedUrls = function () {
|
||||
return getMultipleSignedUrls(this.documentNames, 'belonging-documents')
|
||||
}
|
||||
|
||||
belongingSchema.methods.getImagesSignedUrls = function () {
|
||||
return getMultipleSignedUrls(this.imageNames, 'belonging-images')
|
||||
return getMultipleSignedUrls(this.documentUrls, 'belonging-documents')
|
||||
}
|
||||
|
||||
belongingSchema.methods.getMainImagedSignedUrl = function () {
|
||||
return getMultipleSignedUrls(this.mainImageNames, 'belonging-images')
|
||||
return getMultipleSignedUrls(this.mainImageUrls, 'belonging-images')
|
||||
}
|
||||
|
||||
belongingSchema.index({ location: '2dsphere' }) // Enable geospatial queries
|
||||
|
||||
Reference in New Issue
Block a user