Change order saving endpoint and remove position property

This commit is contained in:
Bubka 2021-09-19 15:04:53 +02:00
parent 59a63f5a2a
commit 5959b692de
3 changed files with 1 additions and 3 deletions

View File

@ -44,7 +44,6 @@ class TwoFAccountController extends Controller
*/
public function index(Request $request)
{
$request->merge(['withPosition' => true]);
$request->merge(['hideSecret' => true]);
return TwoFAccountReadResource::collection(TwoFAccount::ordered()->get());

View File

@ -16,7 +16,6 @@ class TwoFAccountReadResource extends TwoFAccountStoreResource
[
'id' => $this->id,
'group_id' => $this->group_id,
'position' => $this->when($request->input('withPosition'), $this->order_column),
],
parent::toArray($request)
);

View File

@ -37,7 +37,7 @@ Route::group(['middleware' => 'auth:api'], function() {
});
Route::delete('twofaccounts/batch', 'TwoFAccountController@batchDestroy');
Route::patch('twofaccounts/sort-order', 'TwoFAccountController@reorder');
Route::post('twofaccounts/reorder', 'TwoFAccountController@reorder');
Route::post('twofaccounts/preview', 'TwoFAccountController@preview');
Route::get('twofaccounts/{twofaccount}/qrcode', 'QrCodeController@show');
Route::get('twofaccounts/count', 'TwoFAccountController@count');