backend: versioned API
This commit is contained in:
1 parent
599237dd2c
commit
bbbbca95fa
14 files changed
+58
-45
No files matched your search
@@ -8,7 +8,7 @@ namespace Helpdesk.Api.Controllers;
|
||||
/// <summary>Číselníky pro formuláře (budovy, kategorie závad a návrhů) a jejich správa.</summary>
|
||||
[ApiController]
|
||||
[Authorize]
|
||||
[Route("api")]
|
||||
[Route(ApiRoutes.V1)]
|
||||
[Produces("application/json")]
|
||||
public sealed class CatalogsController(CatalogService catalogs) : ControllerBase
|
||||
{
|
||||
@@ -24,7 +24,7 @@ public sealed class CatalogsController(CatalogService catalogs) : ControllerBase
|
||||
public async Task<ActionResult<BuildingDto>> CreateBuilding(SaveBuildingRequest request, CancellationToken ct)
|
||||
{
|
||||
var building = await catalogs.CreateBuildingAsync(request, ct);
|
||||
return Created($"/api/buildings/{building.Id}", building);
|
||||
return Created($"/{ApiRoutes.V1}/buildings/{building.Id}", building);
|
||||
}
|
||||
|
||||
[Authorize(Roles = Roles.Admin)]
|
||||
@@ -59,7 +59,7 @@ public sealed class CatalogsController(CatalogService catalogs) : ControllerBase
|
||||
public async Task<ActionResult<CategoryDto>> CreateIssueCategory(SaveCategoryRequest request, CancellationToken ct)
|
||||
{
|
||||
var category = await catalogs.CreateIssueCategoryAsync(request, ct);
|
||||
return Created($"/api/issue-categories/{category.Id}", category);
|
||||
return Created($"/{ApiRoutes.V1}/issue-categories/{category.Id}", category);
|
||||
}
|
||||
|
||||
[Authorize(Roles = Roles.Admin)]
|
||||
@@ -95,7 +95,7 @@ public sealed class CatalogsController(CatalogService catalogs) : ControllerBase
|
||||
public async Task<ActionResult<CategoryDto>> CreateProposalCategory(SaveCategoryRequest request, CancellationToken ct)
|
||||
{
|
||||
var category = await catalogs.CreateProposalCategoryAsync(request, ct);
|
||||
return Created($"/api/proposal-categories/{category.Id}", category);
|
||||
return Created($"/{ApiRoutes.V1}/proposal-categories/{category.Id}", category);
|
||||
}
|
||||
|
||||
[Authorize(Roles = Roles.Admin)]
|
||||
|
||||
Reference in new issue
Block a user