@@ -230,7 +230,12 @@ def find_user(params)
230
230
key = user . keys . find_by ( id : params [ :key_id ] )
231
231
not_found! ( 'Key' ) unless key
232
232
233
+ <<<<<<< HEAD
233
234
status 204
235
+ =======
236
+ check_unmodified_since ( key . updated_at )
237
+
238
+ >>>>>>> API : Respect the 'If-Unmodified-Since' for delete endpoints
234
239
key . destroy
235
240
end
236
241
@@ -287,7 +292,14 @@ def find_user(params)
287
292
email = user . emails . find_by ( id : params [ :email_id ] )
288
293
not_found! ( 'Email' ) unless email
289
294
295
+ <<<<<<< HEAD
290
296
Emails ::DestroyService . new ( user , email : email . email ) . execute
297
+ =======
298
+ check_unmodified_since ( email . updated_at )
299
+
300
+ email . destroy
301
+ user . update_secondary_emails!
302
+ >>>>>>> API : Respect the 'If-Unmodified-Since' for delete endpoints
291
303
end
292
304
293
305
desc 'Delete a user. Available only for admins.' do
@@ -299,11 +311,18 @@ def find_user(params)
299
311
end
300
312
delete ":id" do
301
313
authenticated_as_admin!
314
+
302
315
user = User . find_by ( id : params [ :id ] )
303
316
not_found! ( 'User' ) unless user
304
317
318
+ <<<<<<< HEAD
305
319
status 204
306
320
user . delete_async ( deleted_by : current_user , params : params )
321
+ =======
322
+ check_unmodified_since ( user . updated_at )
323
+
324
+ ::Users ::DestroyService . new ( current_user ) . execute ( user )
325
+ >>>>>>> API : Respect the 'If-Unmodified-Since' for delete endpoints
307
326
end
308
327
309
328
desc 'Block a user. Available only for admins.'
@@ -481,6 +500,8 @@ def find_impersonation_token
481
500
key = current_user . keys . find_by ( id : params [ :key_id ] )
482
501
not_found! ( 'Key' ) unless key
483
502
503
+ check_unmodified_since ( key . updated_at )
504
+
484
505
status 204
485
506
key . destroy
486
507
end
@@ -533,6 +554,7 @@ def find_impersonation_token
533
554
email = current_user . emails . find_by ( id : params [ :email_id ] )
534
555
not_found! ( 'Email' ) unless email
535
556
557
+ <<<<<<< HEAD
536
558
status 204
537
559
Emails ::DestroyService . new ( current_user , email : email . email ) . execute
538
560
end
@@ -550,6 +572,12 @@ def find_impersonation_token
550
572
. reorder ( last_activity_on : :asc )
551
573
552
574
present paginate ( activities ) , with : Entities ::UserActivity
575
+ =======
576
+ check_unmodified_since ( email . updated_at )
577
+
578
+ email . destroy
579
+ current_user . update_secondary_emails!
580
+ >>>>>>> API : Respect the 'If-Unmodified-Since' for delete endpoints
553
581
end
554
582
end
555
583
end
0 commit comments