mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 05:47:28 -08:00
Added user locale to REST API GET /api/users response; (#9486)
* Clearer reporting on import Signed-off-by: snipe <snipe@snipe.net> * Try adding text/x-Algol68 to import Signed-off-by: snipe <snipe@snipe.net> * Added user locale to REST API GET /api/users response; Co-authored-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
1d43eda21f
commit
82f73eb9e2
|
@ -49,10 +49,12 @@ class ImportController extends Controller
|
|||
if (!in_array($file->getMimeType(), array(
|
||||
'application/vnd.ms-excel',
|
||||
'text/csv',
|
||||
'application/csv',
|
||||
'text/x-Algol68', // because wtf CSV files?
|
||||
'text/plain',
|
||||
'text/comma-separated-values',
|
||||
'text/tsv'))) {
|
||||
$results['error']='File type must be CSV';
|
||||
$results['error']='File type must be CSV. Uploaded file is '.$file->getMimeType();
|
||||
return response()->json(Helper::formatStandardApiResponse('error', null, $results['error']), 500);
|
||||
}
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@ class UsersController extends Controller
|
|||
'users.jobtitle',
|
||||
'users.last_login',
|
||||
'users.last_name',
|
||||
'users.locale',
|
||||
'users.location_id',
|
||||
'users.manager_id',
|
||||
'users.notes',
|
||||
|
|
|
@ -27,6 +27,7 @@ class UsersTransformer
|
|||
'first_name' => e($user->first_name),
|
||||
'last_name' => e($user->last_name),
|
||||
'username' => e($user->username),
|
||||
'locale' => ($user->locale) ? e($user->locale) : null,
|
||||
'employee_num' => e($user->employee_num),
|
||||
'manager' => ($user->manager) ? [
|
||||
'id' => (int) $user->manager->id,
|
||||
|
|
Loading…
Reference in a new issue