debugging and add image uploader to guild good

This commit is contained in:
2026-04-18 12:14:19 +03:30
parent ca494ee82a
commit 1a3a450960
16 changed files with 214 additions and 144 deletions
+3 -14
View File
@@ -9,25 +9,14 @@ export class UploaderService {
async uploadFile(file: Express.Multer.File, type: UploadedFileTypes) {
const uploaded = await this.storageService.uploadFile(file, type)
return uploaded
// await fs.mkdir(dirPath, { recursive: true })
// await fs.writeFile(filePath, buffer)
// Return a URL path, e.g. /uploads/{accountId}/{type}/{filename}
// return `/uploads/${type}/${filename}`
}
async deleteFile(url: string) {
const key = url?.split('/').pop()
async deleteFile(url: string, type: UploadedFileTypes) {
const key = `${type}/${url?.split('/').pop()}`
if (key) {
return await this.storageService.deleteFile(key)
}
return {}
// await fs.mkdir(dirPath, { recursive: true })
// await fs.writeFile(filePath, buffer)
// Return a URL path, e.g. /uploads/{accountId}/{type}/{filename}
// return `/uploads/${type}/${filename}`
}
}