Skip to content

Commit d84743b

Browse files
committed
Fix GlossaryController route attributes
Routes were incorrectly prefixed with 'api/' causing double prefix (api/Glossary/api/...). Fixed by adding [Route("api")] at class level and removing 'api/' prefix from all method route attributes.
1 parent 2603452 commit d84743b

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

cloud/src/LrmCloud.Api/Controllers/GlossaryController.cs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ namespace LrmCloud.Api.Controllers;
1313
/// Supports both project-level and organization-level glossaries.
1414
/// </summary>
1515
[ApiController]
16+
[Route("api")]
1617
[Authorize]
1718
public class GlossaryController : ApiControllerBase
1819
{
@@ -37,7 +38,7 @@ public GlossaryController(
3738
/// <summary>
3839
/// Get all glossary terms for a project (includes inherited organization terms).
3940
/// </summary>
40-
[HttpGet("api/projects/{projectId:int}/glossary")]
41+
[HttpGet("projects/{projectId:int}/glossary")]
4142
[ProducesResponseType(typeof(ApiResponse<GlossaryListResponse>), 200)]
4243
[ProducesResponseType(typeof(ProblemDetails), 403)]
4344
[ProducesResponseType(typeof(ProblemDetails), 404)]
@@ -63,7 +64,7 @@ public async Task<ActionResult<ApiResponse<GlossaryListResponse>>> GetProjectGlo
6364
/// <summary>
6465
/// Create a new project-level glossary term.
6566
/// </summary>
66-
[HttpPost("api/projects/{projectId:int}/glossary")]
67+
[HttpPost("projects/{projectId:int}/glossary")]
6768
[ProducesResponseType(typeof(ApiResponse<GlossaryTermDto>), 201)]
6869
[ProducesResponseType(typeof(ProblemDetails), 400)]
6970
[ProducesResponseType(typeof(ProblemDetails), 403)]
@@ -94,7 +95,7 @@ public async Task<ActionResult<ApiResponse<GlossaryTermDto>>> CreateProjectTerm(
9495
/// <summary>
9596
/// Update a project-level glossary term.
9697
/// </summary>
97-
[HttpPut("api/projects/{projectId:int}/glossary/{termId:int}")]
98+
[HttpPut("projects/{projectId:int}/glossary/{termId:int}")]
9899
[ProducesResponseType(typeof(ApiResponse<GlossaryTermDto>), 200)]
99100
[ProducesResponseType(typeof(ProblemDetails), 400)]
100101
[ProducesResponseType(typeof(ProblemDetails), 403)]
@@ -131,7 +132,7 @@ public async Task<ActionResult<ApiResponse<GlossaryTermDto>>> UpdateProjectTerm(
131132
/// <summary>
132133
/// Delete a project-level glossary term.
133134
/// </summary>
134-
[HttpDelete("api/projects/{projectId:int}/glossary/{termId:int}")]
135+
[HttpDelete("projects/{projectId:int}/glossary/{termId:int}")]
135136
[ProducesResponseType(204)]
136137
[ProducesResponseType(typeof(ProblemDetails), 403)]
137138
[ProducesResponseType(typeof(ProblemDetails), 404)]
@@ -164,7 +165,7 @@ public async Task<IActionResult> DeleteProjectTerm(int projectId, int termId)
164165
/// <summary>
165166
/// Get all glossary terms for an organization.
166167
/// </summary>
167-
[HttpGet("api/organizations/{organizationId:int}/glossary")]
168+
[HttpGet("organizations/{organizationId:int}/glossary")]
168169
[ProducesResponseType(typeof(ApiResponse<GlossaryListResponse>), 200)]
169170
[ProducesResponseType(typeof(ProblemDetails), 403)]
170171
[ProducesResponseType(typeof(ProblemDetails), 404)]
@@ -188,7 +189,7 @@ public async Task<ActionResult<ApiResponse<GlossaryListResponse>>> GetOrganizati
188189
/// <summary>
189190
/// Create a new organization-level glossary term.
190191
/// </summary>
191-
[HttpPost("api/organizations/{organizationId:int}/glossary")]
192+
[HttpPost("organizations/{organizationId:int}/glossary")]
192193
[ProducesResponseType(typeof(ApiResponse<GlossaryTermDto>), 201)]
193194
[ProducesResponseType(typeof(ProblemDetails), 400)]
194195
[ProducesResponseType(typeof(ProblemDetails), 403)]
@@ -221,7 +222,7 @@ public async Task<ActionResult<ApiResponse<GlossaryTermDto>>> CreateOrganization
221222
/// <summary>
222223
/// Update an organization-level glossary term.
223224
/// </summary>
224-
[HttpPut("api/organizations/{organizationId:int}/glossary/{termId:int}")]
225+
[HttpPut("organizations/{organizationId:int}/glossary/{termId:int}")]
225226
[ProducesResponseType(typeof(ApiResponse<GlossaryTermDto>), 200)]
226227
[ProducesResponseType(typeof(ProblemDetails), 400)]
227228
[ProducesResponseType(typeof(ProblemDetails), 403)]
@@ -260,7 +261,7 @@ public async Task<ActionResult<ApiResponse<GlossaryTermDto>>> UpdateOrganization
260261
/// <summary>
261262
/// Delete an organization-level glossary term.
262263
/// </summary>
263-
[HttpDelete("api/organizations/{organizationId:int}/glossary/{termId:int}")]
264+
[HttpDelete("organizations/{organizationId:int}/glossary/{termId:int}")]
264265
[ProducesResponseType(204)]
265266
[ProducesResponseType(typeof(ProblemDetails), 403)]
266267
[ProducesResponseType(typeof(ProblemDetails), 404)]
@@ -295,7 +296,7 @@ public async Task<IActionResult> DeleteOrganizationTerm(int organizationId, int
295296
/// <summary>
296297
/// Get a single glossary term by ID.
297298
/// </summary>
298-
[HttpGet("api/glossary/{termId:int}")]
299+
[HttpGet("glossary/{termId:int}")]
299300
[ProducesResponseType(typeof(ApiResponse<GlossaryTermDto>), 200)]
300301
[ProducesResponseType(typeof(ProblemDetails), 403)]
301302
[ProducesResponseType(typeof(ProblemDetails), 404)]
@@ -326,7 +327,7 @@ public async Task<ActionResult<ApiResponse<GlossaryTermDto>>> GetTerm(int termId
326327
/// Find glossary terms that match the given source text.
327328
/// Used by UI to show what terms will be applied during translation.
328329
/// </summary>
329-
[HttpPost("api/projects/{projectId:int}/glossary/match")]
330+
[HttpPost("projects/{projectId:int}/glossary/match")]
330331
[ProducesResponseType(typeof(ApiResponse<GlossaryUsageSummary>), 200)]
331332
[ProducesResponseType(typeof(ProblemDetails), 403)]
332333
public async Task<ActionResult<ApiResponse<GlossaryUsageSummary>>> FindMatchingTerms(

0 commit comments

Comments
 (0)