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:
2025-01-04 22:06:43 +03:30
parent 9e342cbc57
commit 2d87cc4834
21 changed files with 2100 additions and 77 deletions
+8 -1
View File
@@ -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
}