This commit is contained in:
2020-07-31 00:04:57 +00:00
parent 7c0f66412f
commit 7ba1f47242
7 changed files with 27 additions and 27 deletions

View File

@@ -101,7 +101,7 @@ namespace AyaNova.Api.Controllers
if (n == null)
return BadRequest(new ApiErrorResponse(ApiErrorCode.NOT_FOUND, "id"));
if (n.UserId != UserId)
return BadRequest(new ApiErrorResponse(ApiErrorCode.NOT_AUTHORIZED, "UserId", "Can't delete notification for another user"));
return BadRequest(new ApiErrorResponse(ApiErrorCode.NOT_AUTHORIZED, null, "Can't delete notification for another user"));
ct.Notification.Remove(n);
await ct.SaveChangesAsync();
return NoContent();