mirror of
https://github.com/GCMatters/hermes.git
synced 2026-02-04 05:30:13 +01:00
fix: remove dto from get request, change the wording of error messages
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using System.Runtime.Intrinsics.Arm;
|
||||
using System.Security.Cryptography;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using WebApp.Data;
|
||||
@@ -153,14 +152,14 @@ namespace WebApp.Endpoints
|
||||
} else
|
||||
{
|
||||
// Ma - (ta para UserId <-> SkillId już istnieje w bazie) użytkownik już ma ten skill
|
||||
return Results.Json(new { message = "User already has this skill" }, statusCode: 400);
|
||||
return Results.Json(new { message = "You already have this skill!" }, statusCode: 400);
|
||||
}
|
||||
|
||||
return Results.Json(new { message = "Skill added successfully!" }, statusCode: 201);
|
||||
});
|
||||
|
||||
|
||||
group.MapDelete("/delete_skill", async (SingleSkillDto dto, HttpContext httpContext, ApplicationDbContext context, GeneralUseHelpers guh) =>
|
||||
group.MapPost("/remove_skill", async (SingleSkillDto dto, HttpContext httpContext, ApplicationDbContext context, GeneralUseHelpers guh) =>
|
||||
{
|
||||
// Uzyskaj użytkownika z tokenu
|
||||
Token? token = await guh.GetTokenFromHTTPContext(httpContext);
|
||||
@@ -194,13 +193,13 @@ namespace WebApp.Endpoints
|
||||
else
|
||||
{
|
||||
// Ma - (ta para UserId <-> SkillId już istnieje w bazie) użytkownik już ma ten skill
|
||||
return Results.Json(new { message = "User already has deleted this skill" }, statusCode: 400);
|
||||
return Results.Json(new { message = "You don't have this skill" }, statusCode: 400);
|
||||
}
|
||||
|
||||
return Results.Json(new { message = "Skill deleted successfully!" }, statusCode: 201);
|
||||
});
|
||||
|
||||
group.MapGet("/get_skills", async (SingleSkillDto dto, HttpContext httpContext, ApplicationDbContext context, GeneralUseHelpers guh) =>
|
||||
group.MapGet("/get_skills", async (HttpContext httpContext, ApplicationDbContext context, GeneralUseHelpers guh) =>
|
||||
{
|
||||
// Uzyskaj użytkownika z tokenu
|
||||
Token? token = await guh.GetTokenFromHTTPContext(httpContext);
|
||||
|
||||
Reference in New Issue
Block a user