mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-02 18:11:10 +00:00
Updates the authorization roles and permissions API routes
This commit is contained in:
1 parent
09681ba1cd
commit
6a2970beba
34 files changed
+116
-116
No files matched your search
@@ -10,6 +10,6 @@ public static partial class ApiRoutes
|
||||
/// </summary>
|
||||
public static class Permissions
|
||||
{
|
||||
public const string GET_PERMISSIONS = "/permissions";
|
||||
public const string GET_PERMISSIONS = "/auth/permissions";
|
||||
}
|
||||
}
|
||||
@@ -10,10 +10,10 @@ public static partial class ApiRoutes
|
||||
/// </summary>
|
||||
public static class Roles
|
||||
{
|
||||
public const string GET_ROLE_PERMISSIONS_BY_ROLE_ID = "/roles/{roleId}/permissions";
|
||||
public const string GET_ROLES = "/roles";
|
||||
public const string CREATE_ROLE = "/roles";
|
||||
public const string UPDATE_ROLE = "/roles";
|
||||
public const string DELETE_ROLE = "/roles/{roleId}";
|
||||
public const string GET_ROLE_PERMISSIONS_BY_ROLE_ID = "/auth/roles/{roleId}/permissions";
|
||||
public const string GET_ROLES = "/auth/roles";
|
||||
public const string CREATE_ROLE = "/auth/roles";
|
||||
public const string UPDATE_ROLE = "/auth/roles";
|
||||
public const string DELETE_ROLE = "/auth/roles/{roleId}";
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -16,7 +16,7 @@ using System.Threading.Tasks;
|
||||
namespace Lumina.Presentation.Api.Core.Endpoints.Admin.Authorization.Permissions.GetPermissions;
|
||||
|
||||
/// <summary>
|
||||
/// API endpoint for the <c>/permissions</c> route.
|
||||
/// API endpoint for the <c>/auth/permissions</c> route.
|
||||
/// </summary>
|
||||
public class GetPermissionsEndpoint : BaseEndpoint<EmptyRequest, IResult>
|
||||
{
|
||||
|
||||
+4
-4
@@ -40,7 +40,7 @@ public class GetPermissionsEndpointSummary : Summary<GetPermissionsEndpoint, Emp
|
||||
status = 401,
|
||||
title = "Unauthorized",
|
||||
detail = "You are not authorized",
|
||||
instance = "/api/v1/permissions"
|
||||
instance = "/api/v1/auth/permissions"
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -48,7 +48,7 @@ public class GetPermissionsEndpointSummary : Summary<GetPermissionsEndpoint, Emp
|
||||
status = 401,
|
||||
title = "Unauthorized",
|
||||
detail = "Invalid token: The token expired at '01/01/2024 01:00:00'",
|
||||
instance = "/api/v1/permissions"
|
||||
instance = "/api/v1/auth/permissions"
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -56,7 +56,7 @@ public class GetPermissionsEndpointSummary : Summary<GetPermissionsEndpoint, Emp
|
||||
status = 401,
|
||||
title = "Unauthorized",
|
||||
detail = "The token is invalid",
|
||||
instance = "/api/v1/permissions"
|
||||
instance = "/api/v1/auth/permissions"
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -68,7 +68,7 @@ public class GetPermissionsEndpointSummary : Summary<GetPermissionsEndpoint, Emp
|
||||
title = "General.Failure",
|
||||
status = 403,
|
||||
detail = "NotAuthorized",
|
||||
instance = "/api/v1/permissions",
|
||||
instance = "/api/v1/auth/permissions",
|
||||
traceId = "00-a712bbf99ca8ab485f86a762ae5ae74d-b3a2eb78813b0a5d-00"
|
||||
}
|
||||
);
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ using System.Threading.Tasks;
|
||||
namespace Lumina.Presentation.Api.Core.Endpoints.Admin.Authorization.Roles.AddRole;
|
||||
|
||||
/// <summary>
|
||||
/// API endpoint for the <c>/roles</c> route.
|
||||
/// API endpoint for the <c>/auth/roles</c> route.
|
||||
/// </summary>
|
||||
public class AddRoleEndpoint : BaseEndpoint<AddRoleRequest, IResult>
|
||||
{
|
||||
|
||||
+6
-6
@@ -55,7 +55,7 @@ public class AddRoleEndpointSummary : Summary<AddRoleEndpoint, AddRoleRequest>
|
||||
status = 401,
|
||||
title = "Unauthorized",
|
||||
detail = "You are not authorized",
|
||||
instance = "/api/v1/roles"
|
||||
instance = "/api/v1/auth/roles"
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -63,7 +63,7 @@ public class AddRoleEndpointSummary : Summary<AddRoleEndpoint, AddRoleRequest>
|
||||
status = 401,
|
||||
title = "Unauthorized",
|
||||
detail = "Invalid token: The token expired at '01/01/2024 01:00:00'",
|
||||
instance = "/api/v1/roles"
|
||||
instance = "/api/v1/auth/roles"
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -71,7 +71,7 @@ public class AddRoleEndpointSummary : Summary<AddRoleEndpoint, AddRoleRequest>
|
||||
status = 401,
|
||||
title = "Unauthorized",
|
||||
detail = "The token is invalid",
|
||||
instance = "/api/v1/roles"
|
||||
instance = "/api/v1/auth/roles"
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -83,7 +83,7 @@ public class AddRoleEndpointSummary : Summary<AddRoleEndpoint, AddRoleRequest>
|
||||
title = "General.Failure",
|
||||
status = 403,
|
||||
detail = "NotAuthorized",
|
||||
instance = "/api/v1/roles",
|
||||
instance = "/api/v1/auth/roles",
|
||||
traceId = "00-a712bbf99ca8ab485f86a762ae5ae74d-b3a2eb78813b0a5d-00"
|
||||
}
|
||||
);
|
||||
@@ -95,7 +95,7 @@ public class AddRoleEndpointSummary : Summary<AddRoleEndpoint, AddRoleRequest>
|
||||
title = "General.Conflict",
|
||||
status = 409,
|
||||
detail = "RoleAlreadyExists",
|
||||
instance = "/api/v1/roles",
|
||||
instance = "/api/v1/auth/roles",
|
||||
traceId = "00-f8784de7cb2d70b81b2529893068bee7-4779e0404fe5f554-00"
|
||||
}
|
||||
);
|
||||
@@ -107,7 +107,7 @@ public class AddRoleEndpointSummary : Summary<AddRoleEndpoint, AddRoleRequest>
|
||||
title = "General.Validation",
|
||||
status = 422,
|
||||
detail = "OneOrMoreValidationErrorsOccurred",
|
||||
instance = "/api/v1/roles",
|
||||
instance = "/api/v1/auth/roles",
|
||||
errors = new Dictionary<string, string[]>
|
||||
{
|
||||
{
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ using System.Threading.Tasks;
|
||||
namespace Lumina.Presentation.Api.Core.Endpoints.Admin.Authorization.Roles.DeleteRole;
|
||||
|
||||
/// <summary>
|
||||
/// API endpoint for the <c>/roles</c> route.
|
||||
/// API endpoint for the <c>/auth/roles</c> route.
|
||||
/// </summary>
|
||||
public class DeleteRoleEndpoint : BaseEndpoint<DeleteRoleRequest, IResult>
|
||||
{
|
||||
|
||||
+7
-7
@@ -41,7 +41,7 @@ public class DeleteRoleEndpointSummary : Summary<DeleteRoleEndpoint, DeleteRoleR
|
||||
status = 401,
|
||||
title = "Unauthorized",
|
||||
detail = "You are not authorized",
|
||||
instance = "/api/v1/roles/{roleId}"
|
||||
instance = "/api/v1/auth/roles/{roleId}"
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -49,7 +49,7 @@ public class DeleteRoleEndpointSummary : Summary<DeleteRoleEndpoint, DeleteRoleR
|
||||
status = 401,
|
||||
title = "Unauthorized",
|
||||
detail = "Invalid token: The token expired at '01/01/2024 01:00:00'",
|
||||
instance = "/api/v1/roles/{roleId}"
|
||||
instance = "/api/v1/auth/roles/{roleId}"
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -57,7 +57,7 @@ public class DeleteRoleEndpointSummary : Summary<DeleteRoleEndpoint, DeleteRoleR
|
||||
status = 401,
|
||||
title = "Unauthorized",
|
||||
detail = "The token is invalid",
|
||||
instance = "/api/v1/roles/{roleId}"
|
||||
instance = "/api/v1/auth/roles/{roleId}"
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -71,7 +71,7 @@ public class DeleteRoleEndpointSummary : Summary<DeleteRoleEndpoint, DeleteRoleR
|
||||
title = "General.Failure",
|
||||
status = 403,
|
||||
detail = "AdminRoleCannotBeDeleted",
|
||||
instance = "/api/v1/roles/{roleId}",
|
||||
instance = "/api/v1/auth/roles/{roleId}",
|
||||
traceId = "00-a712bbf99ca8ab485f86a762ae5ae74d-b3a2eb78813b0a5d-00"
|
||||
},
|
||||
new
|
||||
@@ -80,7 +80,7 @@ public class DeleteRoleEndpointSummary : Summary<DeleteRoleEndpoint, DeleteRoleR
|
||||
title = "General.Failure",
|
||||
status = 403,
|
||||
detail = "NotAuthorized",
|
||||
instance = "/api/v1/roles/{roleId}",
|
||||
instance = "/api/v1/auth/roles/{roleId}",
|
||||
traceId = "00-a712bbf99ca8ab485f86a762ae5ae74d-b3a2eb78813b0a5d-00"
|
||||
}
|
||||
}
|
||||
@@ -93,7 +93,7 @@ public class DeleteRoleEndpointSummary : Summary<DeleteRoleEndpoint, DeleteRoleR
|
||||
title = "General.NotFound",
|
||||
status = 404,
|
||||
detail = "RoleNotFound",
|
||||
instance = "/api/v1/roles/{roleId}",
|
||||
instance = "/api/v1/auth/roles/{roleId}",
|
||||
traceId = "00-57d15dadd702dbd4aeb5dc9b7cee68ee-9330237dbb2ce0e5-00"
|
||||
}
|
||||
);
|
||||
@@ -105,7 +105,7 @@ public class DeleteRoleEndpointSummary : Summary<DeleteRoleEndpoint, DeleteRoleR
|
||||
title = "General.Validation",
|
||||
status = 422,
|
||||
detail = "OneOrMoreValidationErrorsOccurred",
|
||||
instance = "/api/v1/roles/{roleId}",
|
||||
instance = "/api/v1/auth/roles/{roleId}",
|
||||
errors = new Dictionary<string, string[]>
|
||||
{
|
||||
{
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ using System.Threading.Tasks;
|
||||
namespace Lumina.Presentation.Api.Core.Endpoints.Admin.Authorization.Roles.GetRolePermissions;
|
||||
|
||||
/// <summary>
|
||||
/// API endpoint for the <c>/roles/{roleId}/permissions</c> route.
|
||||
/// API endpoint for the <c>/auth/roles/{roleId}/permissions</c> route.
|
||||
/// </summary>
|
||||
public class GetRolePermissionsEndpoint : BaseEndpoint<GetRolePermissionsRequest, IResult>
|
||||
{
|
||||
|
||||
+6
-6
@@ -46,7 +46,7 @@ public class GetRolePermissionsEndpointSummary : Summary<GetRolePermissionsEndpo
|
||||
status = 401,
|
||||
title = "Unauthorized",
|
||||
detail = "You are not authorized",
|
||||
instance = "/api/v1/roles/{roleId}/permissions"
|
||||
instance = "/api/v1/auth/roles/{roleId}/permissions"
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -54,7 +54,7 @@ public class GetRolePermissionsEndpointSummary : Summary<GetRolePermissionsEndpo
|
||||
status = 401,
|
||||
title = "Unauthorized",
|
||||
detail = "Invalid token: The token expired at '01/01/2024 01:00:00'",
|
||||
instance = "/api/v1/roles/{roleId}/permissions"
|
||||
instance = "/api/v1/auth/roles/{roleId}/permissions"
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -62,7 +62,7 @@ public class GetRolePermissionsEndpointSummary : Summary<GetRolePermissionsEndpo
|
||||
status = 401,
|
||||
title = "Unauthorized",
|
||||
detail = "The token is invalid",
|
||||
instance = "/api/v1/roles/{roleId}/permissions"
|
||||
instance = "/api/v1/auth/roles/{roleId}/permissions"
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -74,7 +74,7 @@ public class GetRolePermissionsEndpointSummary : Summary<GetRolePermissionsEndpo
|
||||
title = "General.Failure",
|
||||
status = 403,
|
||||
detail = "NotAuthorized",
|
||||
instance = "/api/v1/roles/{roleId}/permissions",
|
||||
instance = "/api/v1/auth/roles/{roleId}/permissions",
|
||||
traceId = "00-a712bbf99ca8ab485f86a762ae5ae74d-b3a2eb78813b0a5d-00"
|
||||
}
|
||||
);
|
||||
@@ -86,7 +86,7 @@ public class GetRolePermissionsEndpointSummary : Summary<GetRolePermissionsEndpo
|
||||
title = "General.NotFound",
|
||||
status = 404,
|
||||
detail = "RoleNotFound",
|
||||
instance = "/api/v1/roles/{roleId}/permissions",
|
||||
instance = "/api/v1/auth/roles/{roleId}/permissions",
|
||||
traceId = "00-57d15dadd702dbd4aeb5dc9b7cee68ee-9330237dbb2ce0e5-00"
|
||||
}
|
||||
);
|
||||
@@ -98,7 +98,7 @@ public class GetRolePermissionsEndpointSummary : Summary<GetRolePermissionsEndpo
|
||||
title = "General.Validation",
|
||||
status = 422,
|
||||
detail = "OneOrMoreValidationErrorsOccurred",
|
||||
instance = "/api/v1/roles/{roleId}/permissions",
|
||||
instance = "/api/v1/auth/roles/{roleId}/permissions",
|
||||
errors = new Dictionary<string, string[]>
|
||||
{
|
||||
{
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ using System.Threading.Tasks;
|
||||
namespace Lumina.Presentation.Api.Core.Endpoints.Admin.Authorization.Roles.GetRoles;
|
||||
|
||||
/// <summary>
|
||||
/// API endpoint for the <c>/roles</c> route.
|
||||
/// API endpoint for the <c>/auth/roles</c> route.
|
||||
/// </summary>
|
||||
public class GetRolesEndpoint : BaseEndpoint<EmptyRequest, IResult>
|
||||
{
|
||||
|
||||
+4
-4
@@ -35,7 +35,7 @@ public class GetRolesEndpointSummary : Summary<GetRolesEndpoint, EmptyRequest>
|
||||
status = 401,
|
||||
title = "Unauthorized",
|
||||
detail = "You are not authorized",
|
||||
instance = "/api/v1/roles"
|
||||
instance = "/api/v1/auth/roles"
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -43,7 +43,7 @@ public class GetRolesEndpointSummary : Summary<GetRolesEndpoint, EmptyRequest>
|
||||
status = 401,
|
||||
title = "Unauthorized",
|
||||
detail = "Invalid token: The token expired at '01/01/2024 01:00:00'",
|
||||
instance = "/api/v1/roles"
|
||||
instance = "/api/v1/auth/roles"
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -51,7 +51,7 @@ public class GetRolesEndpointSummary : Summary<GetRolesEndpoint, EmptyRequest>
|
||||
status = 401,
|
||||
title = "Unauthorized",
|
||||
detail = "The token is invalid",
|
||||
instance = "/api/v1/roles"
|
||||
instance = "/api/v1/auth/roles"
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -63,7 +63,7 @@ public class GetRolesEndpointSummary : Summary<GetRolesEndpoint, EmptyRequest>
|
||||
title = "General.Failure",
|
||||
status = 403,
|
||||
detail = "NotAuthorized",
|
||||
instance = "/api/v1/roles",
|
||||
instance = "/api/v1/auth/roles",
|
||||
traceId = "00-a712bbf99ca8ab485f86a762ae5ae74d-b3a2eb78813b0a5d-00"
|
||||
}
|
||||
);
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ using System.Threading.Tasks;
|
||||
namespace Lumina.Presentation.Api.Core.Endpoints.Admin.Authorization.Roles.UpdateRole;
|
||||
|
||||
/// <summary>
|
||||
/// API endpoint for the <c>/roles</c> route.
|
||||
/// API endpoint for the <c>/auth/roles</c> route.
|
||||
/// </summary>
|
||||
public class UpdateRoleEndpoint : BaseEndpoint<UpdateRoleRequest, IResult>
|
||||
{
|
||||
|
||||
+6
-6
@@ -57,7 +57,7 @@ public class UpdateRoleEndpointSummary : Summary<UpdateRoleEndpoint, UpdateRoleR
|
||||
status = 401,
|
||||
title = "Unauthorized",
|
||||
detail = "You are not authorized",
|
||||
instance = "/api/v1/roles"
|
||||
instance = "/api/v1/auth/roles"
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -65,7 +65,7 @@ public class UpdateRoleEndpointSummary : Summary<UpdateRoleEndpoint, UpdateRoleR
|
||||
status = 401,
|
||||
title = "Unauthorized",
|
||||
detail = "Invalid token: The token expired at '01/01/2024 01:00:00'",
|
||||
instance = "/api/v1/roles"
|
||||
instance = "/api/v1/auth/roles"
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -73,7 +73,7 @@ public class UpdateRoleEndpointSummary : Summary<UpdateRoleEndpoint, UpdateRoleR
|
||||
status = 401,
|
||||
title = "Unauthorized",
|
||||
detail = "The token is invalid",
|
||||
instance = "/api/v1/roles"
|
||||
instance = "/api/v1/auth/roles"
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -85,7 +85,7 @@ public class UpdateRoleEndpointSummary : Summary<UpdateRoleEndpoint, UpdateRoleR
|
||||
title = "General.Failure",
|
||||
status = 403,
|
||||
detail = "NotAuthorized",
|
||||
instance = "/api/v1/roles",
|
||||
instance = "/api/v1/auth/roles",
|
||||
traceId = "00-a712bbf99ca8ab485f86a762ae5ae74d-b3a2eb78813b0a5d-00"
|
||||
}
|
||||
);
|
||||
@@ -97,7 +97,7 @@ public class UpdateRoleEndpointSummary : Summary<UpdateRoleEndpoint, UpdateRoleR
|
||||
title = "General.NotFound",
|
||||
status = 404,
|
||||
detail = "RoleNotFound",
|
||||
instance = "/api/v1/roles",
|
||||
instance = "/api/v1/auth/roles",
|
||||
traceId = "00-57d15dadd702dbd4aeb5dc9b7cee68ee-9330237dbb2ce0e5-00"
|
||||
}
|
||||
);
|
||||
@@ -109,7 +109,7 @@ public class UpdateRoleEndpointSummary : Summary<UpdateRoleEndpoint, UpdateRoleR
|
||||
title = "General.Validation",
|
||||
status = 422,
|
||||
detail = "OneOrMoreValidationErrorsOccurred",
|
||||
instance = "/api/v1/roles",
|
||||
instance = "/api/v1/auth/roles",
|
||||
errors = new Dictionary<string, string[]>
|
||||
{
|
||||
{
|
||||
|
||||
@@ -39,8 +39,8 @@ public class AdminController : Controller
|
||||
public async Task<IActionResult> ManageRoles(CancellationToken cancellationToken)
|
||||
{
|
||||
// get the list of roles and permissions from the API
|
||||
ViewData["roles"] = await _apiHttpClient.GetAsync<RoleModel[]>($"roles/", cancellationToken).ConfigureAwait(false);
|
||||
ViewData["permissions"] = await _apiHttpClient.GetAsync<PermissionModel[]>($"permissions/", cancellationToken).ConfigureAwait(false);
|
||||
ViewData["roles"] = await _apiHttpClient.GetAsync<RoleModel[]>($"auth/roles/", cancellationToken).ConfigureAwait(false);
|
||||
ViewData["permissions"] = await _apiHttpClient.GetAsync<PermissionModel[]>($"auth/permissions/", cancellationToken).ConfigureAwait(false);
|
||||
return View();
|
||||
}
|
||||
|
||||
@@ -52,8 +52,8 @@ public class AdminController : Controller
|
||||
public async Task<IActionResult> ManagePermissions(CancellationToken cancellationToken)
|
||||
{
|
||||
ViewData["users"] = await _apiHttpClient.GetAsync<UserModel[]>($"auth/users", cancellationToken).ConfigureAwait(false);
|
||||
ViewData["roles"] = await _apiHttpClient.GetAsync<RoleModel[]>($"roles/", cancellationToken).ConfigureAwait(false);
|
||||
ViewData["permissions"] = await _apiHttpClient.GetAsync<PermissionModel[]>($"permissions/", cancellationToken).ConfigureAwait(false);
|
||||
ViewData["roles"] = await _apiHttpClient.GetAsync<RoleModel[]>($"auth/roles/", cancellationToken).ConfigureAwait(false);
|
||||
ViewData["permissions"] = await _apiHttpClient.GetAsync<PermissionModel[]>($"auth/permissions/", cancellationToken).ConfigureAwait(false);
|
||||
return View();
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public class AdminController : Controller
|
||||
[HttpGet("api-get-permissions-by-role-id/{roleId}")]
|
||||
public async Task<IActionResult> GetPermissionsByRoleId(Guid roleId, CancellationToken cancellationToken)
|
||||
{
|
||||
RolePermissionsModel response = await _apiHttpClient.GetAsync<RolePermissionsModel>($"roles/{roleId}/permissions", cancellationToken).ConfigureAwait(false);
|
||||
RolePermissionsModel response = await _apiHttpClient.GetAsync<RolePermissionsModel>($"auth/roles/{roleId}/permissions", cancellationToken).ConfigureAwait(false);
|
||||
return Json(new { success = true, data = response });
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ public class AdminController : Controller
|
||||
[HttpGet("api-get-roles")]
|
||||
public async Task<IActionResult> GetRoles(CancellationToken cancellationToken)
|
||||
{
|
||||
RoleModel[] response = await _apiHttpClient.GetAsync<RoleModel[]>($"roles/", cancellationToken).ConfigureAwait(false);
|
||||
RoleModel[] response = await _apiHttpClient.GetAsync<RoleModel[]>($"auth/roles/", cancellationToken).ConfigureAwait(false);
|
||||
return Json(new { success = true, data = response });
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ public class AdminController : Controller
|
||||
[HttpPost("api-create-role")]
|
||||
public async Task<IActionResult> CreateRole([FromBody] AddRoleRequestModel model, CancellationToken cancellationToken)
|
||||
{
|
||||
RolePermissionsModel response = await _apiHttpClient.PostAsync<RolePermissionsModel, AddRoleRequestModel>($"roles/", model, cancellationToken).ConfigureAwait(false);
|
||||
RolePermissionsModel response = await _apiHttpClient.PostAsync<RolePermissionsModel, AddRoleRequestModel>($"auth/roles/", model, cancellationToken).ConfigureAwait(false);
|
||||
return Json(new { success = true, data = response });
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ public class AdminController : Controller
|
||||
[HttpPut("api-update-role")]
|
||||
public async Task<IActionResult> UpdateRole([FromBody] UpdateRoleRequestModel model, CancellationToken cancellationToken)
|
||||
{
|
||||
RolePermissionsModel response = await _apiHttpClient.PutAsync<RolePermissionsModel, UpdateRoleRequestModel>($"roles/", model, cancellationToken).ConfigureAwait(false);
|
||||
RolePermissionsModel response = await _apiHttpClient.PutAsync<RolePermissionsModel, UpdateRoleRequestModel>($"auth/roles/", model, cancellationToken).ConfigureAwait(false);
|
||||
return Json(new { success = true, data = response });
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ public class AdminController : Controller
|
||||
[HttpDelete("api-delete-role/{roleId}")]
|
||||
public async Task<IActionResult> DeleteRole(Guid roleId, CancellationToken cancellationToken)
|
||||
{
|
||||
await _apiHttpClient.DeleteAsync($"roles/{roleId}", cancellationToken).ConfigureAwait(false);
|
||||
await _apiHttpClient.DeleteAsync($"auth/roles/{roleId}", cancellationToken).ConfigureAwait(false);
|
||||
return Json(new { success = true });
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user