Fix query and API bugs: 403 for non-owners, page bounds, lifecycle filters, cover fallback, race-safe inserts, async album delete
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
using ErrorOr;
|
||||
|
||||
namespace Musify.Application.Shared;
|
||||
|
||||
public static class AppErrors
|
||||
{
|
||||
public static Error NotFound(string entity, object id) =>
|
||||
Error.NotFound($"{entity}.NotFound", $"{entity} {id} was not found.");
|
||||
|
||||
public static Error Forbidden(string entity, object id) =>
|
||||
Error.Forbidden($"{entity}.Forbidden", $"You do not have permission to modify {entity} {id}.");
|
||||
|
||||
public static Error Conflict(string code, string description) =>
|
||||
Error.Conflict(code, description);
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace Musify.Application.Shared;
|
||||
|
||||
public record PageRequest(int PageNumber = 1, int PageSize = 20)
|
||||
{
|
||||
public const int MaxPageSize = 100;
|
||||
}
|
||||
Reference in New Issue
Block a user