mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Fixed #8613 - Added deleted_at to user API response, added all=true to include deleted and not-deleted in one call
This commit is contained in:
parent
b9330cf6b1
commit
f42bd3a144
|
@ -68,6 +68,8 @@ class UsersController extends Controller
|
||||||
|
|
||||||
if (($request->filled('deleted')) && ($request->input('deleted')=='true')) {
|
if (($request->filled('deleted')) && ($request->input('deleted')=='true')) {
|
||||||
$users = $users->onlyTrashed();
|
$users = $users->onlyTrashed();
|
||||||
|
} elseif (($request->filled('all')) && ($request->input('deleted')=='true')) {
|
||||||
|
$users = $users->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($request->filled('company_id')) {
|
if ($request->filled('company_id')) {
|
||||||
|
|
|
@ -54,7 +54,6 @@ class UsersTransformer
|
||||||
'activated' => ($user->activated =='1') ? true : false,
|
'activated' => ($user->activated =='1') ? true : false,
|
||||||
'two_factor_activated' => ($user->two_factor_active()) ? true : false,
|
'two_factor_activated' => ($user->two_factor_active()) ? true : false,
|
||||||
'two_factor_enrolled' => ($user->two_factor_active_and_enrolled()) ? true : false,
|
'two_factor_enrolled' => ($user->two_factor_active_and_enrolled()) ? true : false,
|
||||||
|
|
||||||
'assets_count' => (int) $user->assets_count,
|
'assets_count' => (int) $user->assets_count,
|
||||||
'licenses_count' => (int) $user->licenses_count,
|
'licenses_count' => (int) $user->licenses_count,
|
||||||
'accessories_count' => (int) $user->accessories_count,
|
'accessories_count' => (int) $user->accessories_count,
|
||||||
|
@ -63,6 +62,7 @@ class UsersTransformer
|
||||||
'created_at' => Helper::getFormattedDateObject($user->created_at, 'datetime'),
|
'created_at' => Helper::getFormattedDateObject($user->created_at, 'datetime'),
|
||||||
'updated_at' => Helper::getFormattedDateObject($user->updated_at, 'datetime'),
|
'updated_at' => Helper::getFormattedDateObject($user->updated_at, 'datetime'),
|
||||||
'last_login' => Helper::getFormattedDateObject($user->last_login, 'datetime'),
|
'last_login' => Helper::getFormattedDateObject($user->last_login, 'datetime'),
|
||||||
|
'deleted_at' => ($user->deleted_at) ? Helper::getFormattedDateObject($user->deleted_at, 'datetime') : null,
|
||||||
];
|
];
|
||||||
|
|
||||||
$permissions_array['available_actions'] = [
|
$permissions_array['available_actions'] = [
|
||||||
|
|
Loading…
Reference in a new issue