mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-25 12:41:16 -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);
|
$user = User::findOrFail($id);
|
||||||
|
|
||||||
if (empty($user->email)) {
|
if (empty($user->email)) {
|
||||||
return response()->json(
|
return response()->json(Helper::formatStandardApiResponse(‘error’, $accessory, trans('admin/accessories/message.inventorynotification.error')));
|
||||||
[
|
|
||||||
'status' => 'error',
|
|
||||||
'message' => 'This user has no email set.',
|
|
||||||
'payload' => null,
|
|
||||||
], 404);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$user->notify((new CurrentInventory($user)));
|
return response()->Helper::formatStandardApiResponse('success', $accessory, trans('admin/accessories/message.inventorynotification.success'));
|
||||||
|
|
||||||
return response()->json(
|
|
||||||
[
|
|
||||||
'status' => 'success',
|
|
||||||
'message' => 'The user was notified about his current inventory.',
|
|
||||||
'payload' => null,
|
|
||||||
], 200);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -31,6 +31,11 @@ return array(
|
||||||
'error' => 'Accessory was not checked in, please try again',
|
'error' => 'Accessory was not checked in, please try again',
|
||||||
'success' => 'Accessory checked in successfully.',
|
'success' => 'Accessory checked in successfully.',
|
||||||
'user_does_not_exist' => 'That user is invalid. Please try again.'
|
'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