mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 05:47:28 -08:00
Update to PR#12119, adding inventory notification to messages and changing code to be dynamicaly translated
This commit is contained in:
parent
3ef578eb56
commit
39e06a8856
|
@ -505,22 +505,11 @@ class UsersController extends Controller
|
|||
$user = User::findOrFail($id);
|
||||
|
||||
if (empty($user->email)) {
|
||||
return response()->json(
|
||||
[
|
||||
'status' => 'error',
|
||||
'message' => 'This user has no email set.',
|
||||
'payload' => null,
|
||||
], 404);
|
||||
return response()->json(Helper::formatStandardApiResponse(‘error’, $accessory, trans('admin/accessories/message.inventorynotification.error')));
|
||||
}
|
||||
|
||||
$user->notify((new CurrentInventory($user)));
|
||||
|
||||
return response()->json(
|
||||
[
|
||||
'status' => 'success',
|
||||
'message' => 'The user was notified about his current inventory.',
|
||||
'payload' => null,
|
||||
], 200);
|
||||
|
||||
return response()->Helper::formatStandardApiResponse('success', $accessory, trans('admin/accessories/message.inventorynotification.success'));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -31,6 +31,11 @@ return array(
|
|||
'error' => 'Accessory was not checked in, please try again',
|
||||
'success' => 'Accessory checked in successfully.',
|
||||
'user_does_not_exist' => 'That user is invalid. Please try again.'
|
||||
),
|
||||
|
||||
'inventorynotification' => array(
|
||||
'error' => 'This user has no email set.',
|
||||
'success' => 'The user has been notified about their current inventory.'
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue