Skip to content

Commit 6df1dd9

Browse files
committed
More endpoint cleanup
1 parent d61d822 commit 6df1dd9

8 files changed

Lines changed: 8 additions & 13 deletions

File tree

API/Controller/Account/Signup.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ public async Task<IActionResult> SignUp([FromBody] SignUp body)
2727
var creationAction = await _accountService.CreateAccount(body.Email, body.Username, body.Password);
2828
if (creationAction.IsT1) return Problem(SignupError.EmailAlreadyExists);
2929

30-
3130
return LegacyEmptyOk("Successfully signed up");
3231
}
3332
}

API/Controller/Account/_ApiController.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ namespace OpenShock.API.Controller.Account;
1313
/// </summary>
1414
[ApiController]
1515
[Tags("Account")]
16-
[ApiVersion("1")]
17-
[ApiVersion("2")]
16+
[ApiVersion("1"), ApiVersion("2")]
1817
[Route("/{version:apiVersion}/account")]
1918
public sealed partial class AccountController : OpenShockControllerBase
2019
{

API/Controller/Devices/DevicesController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public async Task<IActionResult> RemoveDevice([FromRoute] Guid deviceId, [FromSe
146146
/// <response code="201">Successfully created device</response>
147147
[HttpPost]
148148
[TokenPermission(PermissionType.Devices_Edit)]
149-
[ProducesResponseType<Guid>(StatusCodes.Status201Created, MediaTypeNames.Application.Json)]
149+
[ProducesResponseType<Guid>(StatusCodes.Status201Created, MediaTypeNames.Text.Plain)]
150150
[MapToApiVersion("1")]
151151
public Task<IActionResult> CreateDevice([FromServices] IDeviceUpdateService updateService)
152152
=> CreateDeviceV2(new HubCreateRequest
@@ -161,7 +161,7 @@ public Task<IActionResult> CreateDevice([FromServices] IDeviceUpdateService upda
161161
/// <response code="201">Successfully created device</response>
162162
[HttpPost]
163163
[TokenPermission(PermissionType.Devices_Edit)]
164-
[ProducesResponseType<Guid>(StatusCodes.Status201Created, MediaTypeNames.Application.Json)]
164+
[ProducesResponseType<Guid>(StatusCodes.Status201Created, MediaTypeNames.Text.Plain)]
165165
[MapToApiVersion("2")]
166166
public async Task<IActionResult> CreateDeviceV2([FromBody] HubCreateRequest data, [FromServices] IDeviceUpdateService updateService)
167167
{

API/Controller/Devices/_ApiController.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ namespace OpenShock.API.Controller.Devices;
1313
/// </summary>
1414
[ApiController]
1515
[Tags("Hub Management")]
16-
[ApiVersion("1")]
17-
[ApiVersion("2")]
16+
[ApiVersion("1"), ApiVersion("2")]
1817
[Route("/{version:apiVersion}/devices")]
1918
[Authorize(AuthenticationSchemes = OpenShockAuthSchemas.UserSessionApiTokenCombo)]
2019
public sealed partial class DevicesController : AuthenticatedSessionControllerBase

API/Controller/Shares/V2CreateShareRequest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace OpenShock.API.Controller.Shares;
1414
public sealed partial class SharesController
1515
{
1616
[HttpPost("requests")]
17-
[ProducesResponseType<Guid>(StatusCodes.Status200OK, MediaTypeNames.Application.Json)]
17+
[ProducesResponseType<Guid>(StatusCodes.Status200OK, MediaTypeNames.Text.Plain)]
1818
[ProducesResponseType<OpenShockProblem>(StatusCodes.Status404NotFound, MediaTypeNames.Application.ProblemJson)] // UserNotFound, ShareCreateShockerNotFound
1919
[ProducesResponseType<OpenShockProblem>(StatusCodes.Status400BadRequest, MediaTypeNames.Application.ProblemJson)] // ShareCreateCannotShareWithSelf
2020
[ApiVersion("2")]

API/Controller/Shares/_ApiController.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ namespace OpenShock.API.Controller.Shares;
1212
/// </summary>
1313
[ApiController]
1414
[Tags("Shocker Shares")]
15-
[ApiVersion("1")]
16-
[ApiVersion("2")]
15+
[ApiVersion("1"), ApiVersion("2")]
1716
[Route("/{version:apiVersion}/shares")]
1817
[Authorize(AuthenticationSchemes = OpenShockAuthSchemas.UserSessionApiTokenCombo)]
1918
public sealed partial class SharesController : AuthenticatedSessionControllerBase

API/Controller/Shockers/PauseShockerController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public sealed partial class ShockerController
2424
/// <response code="404">Shocker not found or does not belong to you</response>
2525
[HttpPost("{shockerId}/pause")]
2626
[TokenPermission(PermissionType.Shockers_Pause)]
27-
[ProducesResponseType<LegacyDataResponse<bool?>>(StatusCodes.Status200OK, MediaTypeNames.Application.Json)]
27+
[ProducesResponseType<LegacyDataResponse<bool>>(StatusCodes.Status200OK, MediaTypeNames.Application.Json)]
2828
[ProducesResponseType<OpenShockProblem>(StatusCodes.Status404NotFound, MediaTypeNames.Application.ProblemJson)] // ShockerNotFound
2929
[MapToApiVersion("1")]
3030
public async Task<IActionResult> PauseShocker([FromRoute] Guid shockerId, [FromBody] PauseRequest body,

API/Controller/Shockers/_ApiController.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ namespace OpenShock.API.Controller.Shockers;
1212
/// </summary>
1313
[ApiController]
1414
[Tags("Shockers")]
15-
[ApiVersion("1")]
16-
[ApiVersion("2")]
15+
[ApiVersion("1"), ApiVersion("2")]
1716
[Route("/{version:apiVersion}/shockers")]
1817
[Authorize(AuthenticationSchemes = OpenShockAuthSchemas.UserSessionApiTokenCombo)]
1918
public sealed partial class ShockerController : AuthenticatedSessionControllerBase

0 commit comments

Comments
 (0)