fix: admin couldn't delete shares created by anonymous users

This commit is contained in:
Elias Schneider
2024-05-17 15:13:56 +02:00
parent a3a7a5d9ab
commit 7afda85f03
3 changed files with 19 additions and 7 deletions

View File

@@ -94,8 +94,9 @@ export class ShareController {
@Delete(":id")
@UseGuards(ShareOwnerGuard)
async remove(@Param("id") id: string) {
await this.shareService.remove(id);
async remove(@Param("id") id: string, @GetUser() user: User) {
const isDeleterAdmin = user?.isAdmin === true;
await this.shareService.remove(id, isDeleterAdmin);
}
@Throttle(10, 60)