Delete item first and check permission.

This commit is contained in:
Mehmet Tüken
2021-01-10 12:00:06 +03:00
parent d9dc466f9a
commit 238d741c45

View File

@@ -104,6 +104,8 @@ export class FilesService extends ItemsService {
throw new ForbiddenException();
}
await super.delete(keys);
files = toArray(files);
for (const file of files) {
@@ -115,8 +117,6 @@ export class FilesService extends ItemsService {
}
}
await super.delete(keys);
if (cache && env.CACHE_AUTO_PURGE) {
await cache.clear();
}