44using Microsoft . EntityFrameworkCore ;
55using OpenShock . API . Models . Requests ;
66using OpenShock . API . Models . Response ;
7- using OpenShock . API . Services ;
87using OpenShock . API . Services . DeviceUpdate ;
8+ using OpenShock . API . Utils ;
99using OpenShock . Common . Errors ;
1010using OpenShock . Common . Extensions ;
1111using OpenShock . Common . Models ;
1212using OpenShock . Common . OpenShockDb ;
1313using OpenShock . Common . Problems ;
1414
15- namespace OpenShock . API . Controller . Shares ;
15+ namespace OpenShock . API . Controller . Shares . UserShares ;
1616
1717file static class QueryHelper
1818{
@@ -54,10 +54,10 @@ file static class QueryHelper
5454 } ;
5555}
5656
57- public sealed partial class SharesController
57+ public sealed partial class UserSharesController
5858{
5959 [ HttpGet ( "invites/outgoing" ) ]
60- [ ApiVersion ( "2" ) ]
60+ [ MapToApiVersion ( "2" ) ]
6161 public IAsyncEnumerable < ShareInviteBaseDetails > GetOutgoingInvitesList ( )
6262 {
6363 return _db . UserShareInvites
@@ -67,7 +67,7 @@ public IAsyncEnumerable<ShareInviteBaseDetails> GetOutgoingInvitesList()
6767 }
6868
6969 [ HttpGet ( "invites/incoming" ) ]
70- [ ApiVersion ( "2" ) ]
70+ [ MapToApiVersion ( "2" ) ]
7171 public IAsyncEnumerable < ShareInviteBaseDetails > GetIncomingInvitesList ( )
7272 {
7373 return _db . UserShareInvites
@@ -79,7 +79,7 @@ public IAsyncEnumerable<ShareInviteBaseDetails> GetIncomingInvitesList()
7979 [ HttpDelete ( "invites/outgoing/{inviteId}" ) ]
8080 [ ProducesResponseType ( StatusCodes . Status200OK ) ]
8181 [ ProducesResponseType < OpenShockProblem > ( StatusCodes . Status404NotFound , MediaTypeNames . Application . ProblemJson ) ] // ShareRequestNotFound
82- [ ApiVersion ( "2" ) ]
82+ [ MapToApiVersion ( "2" ) ]
8383 public async Task < IActionResult > DeleteOutgoingInvite ( [ FromRoute ] Guid inviteId )
8484 {
8585 var deletedShareRequest = await _db . UserShareInvites
@@ -93,7 +93,7 @@ public async Task<IActionResult> DeleteOutgoingInvite([FromRoute] Guid inviteId)
9393 [ HttpDelete ( "invites/incoming/{inviteId}" ) ]
9494 [ ProducesResponseType ( StatusCodes . Status200OK ) ]
9595 [ ProducesResponseType < OpenShockProblem > ( StatusCodes . Status404NotFound , MediaTypeNames . Application . ProblemJson ) ] // ShareRequestNotFound
96- [ ApiVersion ( "2" ) ]
96+ [ MapToApiVersion ( "2" ) ]
9797 public async Task < IActionResult > DenyIncomingInvite ( [ FromRoute ] Guid inviteId )
9898 {
9999 var deletedShareRequest = await _db . UserShareInvites
@@ -113,7 +113,7 @@ public async Task<IActionResult> DenyIncomingInvite([FromRoute] Guid inviteId)
113113 [ HttpPost ( "invites/incoming/{inviteId}" ) ]
114114 [ ProducesResponseType < V2UserSharesListItem > ( StatusCodes . Status200OK ) ]
115115 [ ProducesResponseType < OpenShockProblem > ( StatusCodes . Status404NotFound , MediaTypeNames . Application . ProblemJson ) ] // ShareRequestNotFound
116- [ ApiVersion ( "2" ) ]
116+ [ MapToApiVersion ( "2" ) ]
117117 public async Task < IActionResult > RedeemInvite ( [ FromRoute ] Guid inviteId , [ FromServices ] IDeviceUpdateService deviceUpdateService )
118118 {
119119 var shareRequest = await _db . UserShareInvites
@@ -191,7 +191,7 @@ public async Task<IActionResult> RedeemInvite([FromRoute] Guid inviteId, [FromSe
191191 Duration = y . MaxDuration ,
192192 Intensity = y . MaxIntensity
193193 } ,
194- Paused = y . IsPaused
194+ Paused = UserShareUtils . GetPausedReason ( y . IsPaused , y . Shocker . IsPaused )
195195 } )
196196 } ;
197197
0 commit comments