Update to PR#12119, adding inventory notification to messages and changing code to be dynamicaly translated

This commit is contained in:
akemi 2022-11-28 13:52:43 -05:00
parent 3ef578eb56
commit 39e06a8856
2 changed files with 9 additions and 15 deletions

View file

@ -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()->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);
}
/**

View file

@ -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.'
)