mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-10-15 01:54:43 +00:00
Enforce brewery ownership on update and delete (#267)
This commit is contained in:
@@ -36,7 +36,7 @@ public record BreweryDto(
|
||||
/// The distance, in metres, from a query's origin point, or <see langword="null"/> for queries with no
|
||||
/// origin point (e.g. <c>GET /api/brewery/locations</c>).
|
||||
/// </param>
|
||||
public record SimplifiedBreweryDto(
|
||||
public record BreweryWithLocationDto(
|
||||
Guid BreweryPostId,
|
||||
string BreweryName,
|
||||
BreweryLocationDto? Location,
|
||||
|
||||
@@ -45,9 +45,9 @@ public static class BreweryDtoMapper
|
||||
/// Converts a <see cref="BreweryPost" /> to its simplified DTO representation, used for
|
||||
/// location-based queries that only need identifying and location details.
|
||||
/// </summary>
|
||||
public static SimplifiedBreweryDto ToSimplifiedDto(this BreweryPost brewery)
|
||||
public static BreweryWithLocationDto ToSimplifiedDto(this BreweryPost brewery)
|
||||
{
|
||||
return new SimplifiedBreweryDto(
|
||||
return new BreweryWithLocationDto(
|
||||
BreweryPostId: brewery.BreweryPostId,
|
||||
BreweryName: brewery.BreweryName,
|
||||
Location: brewery.Location is null
|
||||
|
||||
Reference in New Issue
Block a user