@@ -110,13 +110,13 @@ public async Task<IActionResult> DenyIncomingInvite(Guid id)
110110 /// <param name="deviceUpdateService"></param>
111111 /// <returns></returns>
112112 [ HttpPost ( "invites/incoming/{id:guid}" ) ]
113- [ ProducesResponseType ( StatusCodes . Status200OK ) ]
113+ [ ProducesResponseType < V2UserSharesListItem > ( StatusCodes . Status200OK ) ]
114114 [ ProducesResponseType < OpenShockProblem > ( StatusCodes . Status404NotFound , MediaTypeNames . Application . ProblemJson ) ] // ShareRequestNotFound
115115 [ ApiVersion ( "2" ) ]
116116 public async Task < IActionResult > RedeemInvite ( Guid id , [ FromServices ] IDeviceUpdateService deviceUpdateService )
117117 {
118118 var shareRequest = await _db . UserShareInvites
119- . Include ( x => x . ShockerMappings )
119+ . Include ( x => x . ShockerMappings ) . Include ( x => x . Owner )
120120 . FirstOrDefaultAsync ( x => x . Id == id && ( x . RecipientUserId == null || x . RecipientUserId == CurrentUser . Id ) ) ;
121121
122122 if ( shareRequest is null ) return Problem ( ShareError . ShareRequestNotFound ) ;
@@ -164,8 +164,37 @@ public async Task<IActionResult> RedeemInvite(Guid id, [FromServices] IDeviceUpd
164164 {
165165 await deviceUpdateService . UpdateDevice ( shareRequest . OwnerId , affectedHub , DeviceUpdateType . ShockerUpdated , CurrentUser . Id ) ;
166166 }
167+
168+
169+ var returnObject = new V2UserSharesListItemDto ( )
170+ {
171+ Id = shareRequest . OwnerId ,
172+ Email = shareRequest . Owner . Email ,
173+ Name = shareRequest . Owner . Name ,
174+ Shares = shareRequest . ShockerMappings . Select ( y => new UserShareInfo
175+ {
176+ Id = y . Shocker . Id ,
177+ Name = y . Shocker . Name ,
178+ CreatedOn = DateTime . UtcNow ,
179+ Permissions = new ShockerPermissions
180+ {
181+ Sound = y . AllowSound ,
182+ Vibrate = y . AllowVibrate ,
183+ Shock = y . AllowShock ,
184+ Live = y . AllowLiveControl
185+ } ,
186+ Limits = new ShockerLimits
187+ {
188+ Duration = y . MaxDuration ,
189+ Intensity = y . MaxIntensity
190+ } ,
191+ Paused = y . IsPaused
192+ } )
193+ } ;
194+
167195
168- return Ok ( ) ;
196+
197+ return Ok ( returnObject . ToV2UserSharesListItem ( ) ) ;
169198 }
170199}
171200
0 commit comments