Delete Folder in Storage
I have this problem:
await this.orderSvc.deleteAttachment(${this.order.branch_id}/${this.order.id});
async deleteAttachment(path: string) {
return new Promise(async (resolve, reject) => {
let { error, data } = await this.supabase.storage.from(this.from_attachments).remove([path]);
if (error) {
reject(error);
} else {
resolve(data);
}
});
}
I create a folder with the branch_id, and then a child folder with the order_id, and inside i upload the files. But when I trigger remove([path]) to remove the order_id folder, is not deleted.
Is this way to do it or there's a better way? Thank you!
await this.orderSvc.deleteAttachment(${this.order.branch_id}/${this.order.id});
async deleteAttachment(path: string) {
return new Promise(async (resolve, reject) => {
let { error, data } = await this.supabase.storage.from(this.from_attachments).remove([path]);
if (error) {
reject(error);
} else {
resolve(data);
}
});
}
I create a folder with the branch_id, and then a child folder with the order_id, and inside i upload the files. But when I trigger remove([path]) to remove the order_id folder, is not deleted.
Is this way to do it or there's a better way? Thank you!