Fix workspace folder deletion error (#13270)
context : workspace folder deletion throws error when folder does not exist (in case, workspace users have not upload any files (profil pic, workflows, attachments, ...)) -> sentry errors : https://twenty-v7.sentry.io/issues/6565008010/?referrer=github_integration solution : check folder existence before deleting test local and s3 storage : - create a workspace and delete workspace - create a workspace, add an attachment and delete workspace closes : https://github.com/twentyhq/twenty/issues/10745 closes : https://github.com/twentyhq/twenty/issues/12299
This commit is contained in:
@@ -93,6 +93,13 @@ export class FileService {
|
||||
async deleteWorkspaceFolder(workspaceId: string) {
|
||||
const workspaceFolderPath = `workspace-${workspaceId}`;
|
||||
|
||||
const isWorkspaceFolderFound =
|
||||
await this.fileStorageService.checkFolderExists(workspaceFolderPath);
|
||||
|
||||
if (!isWorkspaceFolderFound) {
|
||||
return;
|
||||
}
|
||||
|
||||
return await this.fileStorageService.delete({
|
||||
folderPath: workspaceFolderPath,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user