ADD: SignedUrls for documents, mainImage and images
ADD: Bucket and Upload System ADD: New errors ADD: Virtuals for categories ADD: Features system ADD: File management system
This commit is contained in:
@@ -12,12 +12,19 @@ const createBelonging = async (data) => {
|
||||
}
|
||||
|
||||
const getBelonging = async (belongingId) => {
|
||||
const belonging = await Belonging.findById(belongingId, null, null)
|
||||
const belonging = await Belonging.findById(belongingId, null, null).lean()
|
||||
|
||||
if (!belonging) {
|
||||
throw new AppError('NoBelongingFound', 404, {})
|
||||
}
|
||||
|
||||
|
||||
belonging.signedDocumentUrls = belonging.getDocumentsSignedUrls()
|
||||
belonging.signedImageUrls = belonging.getImagesSignedUrls()
|
||||
belonging.signedMainImageUrls = belonging.getMainImagedSignedUrl()
|
||||
|
||||
|
||||
|
||||
return belonging
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user