repo fix
This commit is contained in:
@ -17,7 +17,7 @@ namespace Yuna.Website.Server.API
|
||||
app.MapDelete("/api/device/{id:long}", () => { })
|
||||
.WithTags("device");
|
||||
|
||||
app.MapGet("/api/device/{id:long}", () => { })
|
||||
app.MapGet("/api/device/{deviceId:long}", GetById)
|
||||
.WithTags("device");
|
||||
|
||||
app.MapGet("/api/device", GetAll)
|
||||
@ -58,6 +58,16 @@ namespace Yuna.Website.Server.API
|
||||
return Results.Ok(result);
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public async Task<IResult> GetById(long deviceId,IDeviceService deviceService)
|
||||
{
|
||||
var result = await deviceService.GetById(deviceId);
|
||||
|
||||
if (result is null) return Results.NotFound(deviceId);
|
||||
|
||||
return Results.Ok(result);
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public async Task<IResult> GetAll(IDeviceService deviceService)
|
||||
{
|
||||
|
Reference in New Issue
Block a user