finalisation des endpoints
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
using FastEndpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PF3.DTO.SoundCategory.Request;
|
||||
using PF3.DTO.SoundCategory.Response;
|
||||
using PyroFetes.DTO.SoundCategory.Request;
|
||||
using PyroFetes.DTO.SoundCategory.Response;
|
||||
|
||||
namespace PF3.Endpoints.SoundCategory;
|
||||
namespace PyroFetes.Endpoints.SoundCategory;
|
||||
|
||||
public class UpdateSoundCategoryEndpoint(PF3DbContext pf3DbContext) : Endpoint<UpdateSoundCategoryDto, ReadSoundCategoryDto>
|
||||
public class UpdateSoundCategoryEndpoint(PyroFetesDbContext pf3DbContext) : Endpoint<UpdateSoundCategoryDto, ReadSoundCategoryDto>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
@@ -15,7 +15,7 @@ public class UpdateSoundCategoryEndpoint(PF3DbContext pf3DbContext) : Endpoint<U
|
||||
|
||||
public override async Task HandleAsync(UpdateSoundCategoryDto req, CancellationToken ct)
|
||||
{
|
||||
var soundCategory = await pf3DbContext.SoundsCategorys.FirstOrDefaultAsync(st => st.Id == req.Id, ct);
|
||||
var soundCategory = await pf3DbContext.SoundCategories.FirstOrDefaultAsync(st => st.Id == req.Id, ct);
|
||||
if (soundCategory is null)
|
||||
{
|
||||
await Send.NotFoundAsync(ct);
|
||||
|
||||
Reference in New Issue
Block a user