Skip to content

Commit

Permalink
fixed wear and wash api endpionts
Browse files Browse the repository at this point in the history
  • Loading branch information
m-GDEV committed Oct 6, 2024
1 parent 5d4481c commit 01eb651
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions WardrobeManager.Api/Endpoints/ActionEndpoints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@ public static void MapActionEndpoints(this IEndpointRouteBuilder app) {

public static async Task<IResult> WearClothing
(
int itemId, HttpContext context, IClothingItemService clothingItemService
int id, HttpContext context, IClothingItemService clothingItemService
){
User? user = context.Items["user"] as User;
Debug.Assert(user != null, "Cannot get user");

await clothingItemService.CallMethodOnClothingItem(user.Id, itemId, ActionType.Wear);
await clothingItemService.CallMethodOnClothingItem(user.Id, id, ActionType.Wear);

return Results.Ok("Item Worn");
}
public static async Task<IResult> WashClothing
(
int itemId, HttpContext context, IClothingItemService clothingItemService
int id, HttpContext context, IClothingItemService clothingItemService
){
User? user = context.Items["user"] as User;
Debug.Assert(user != null, "Cannot get user");

await clothingItemService.CallMethodOnClothingItem(user.Id, itemId, ActionType.Wash);
await clothingItemService.CallMethodOnClothingItem(user.Id, id, ActionType.Wash);
return Results.Ok("Item Worn");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public async Task Wear(ServerClothingItem clothing)
}
public async Task Wash(ServerClothingItem clothing)
{
var res = await _httpClient.GetAsync($"/actions/wear/{clothing.Id}");
var res = await _httpClient.GetAsync($"/actions/wash/{clothing.Id}");
res.EnsureSuccessStatusCode();
}

Expand Down

0 comments on commit 01eb651

Please sign in to comment.