Skip to content

Commit 21205ee

Browse files
Move GetProjectById method to reorganize controller structure for better readability
1 parent d0f0988 commit 21205ee

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/Controllers/Projects/ProjectsController.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ public async Task<IActionResult> GetRandomProjects([FromQuery] int take = 20, Ca
2222
return Ok(response);
2323
}
2424

25+
// Get project by id
26+
[HttpGet("{projectId:guid}")]
27+
public async Task<IActionResult> GetProjectById(Guid projectId, CancellationToken ct = default)
28+
{
29+
var project = await _projects.GetProjectByIdAsync(projectId, ct);
30+
return Ok(project);
31+
}
32+
2533
// Create project
2634
[HttpPost("create")]
2735
public async Task<IActionResult> CreateProject([FromBody] CreateProjectRequest request)
@@ -33,14 +41,6 @@ public async Task<IActionResult> CreateProject([FromBody] CreateProjectRequest r
3341
return Ok(response);
3442
}
3543

36-
// Get project by id
37-
[HttpGet("{projectId:guid}")]
38-
public async Task<IActionResult> GetProjectById(Guid projectId, CancellationToken ct = default)
39-
{
40-
var project = await _projects.GetProjectByIdAsync(projectId, ct);
41-
return Ok(project);
42-
}
43-
4444
// Update project by id (admin only)
4545
[HttpPut("update/{projectId:guid}")]
4646
public async Task<IActionResult> UpdateProject(

0 commit comments

Comments
 (0)