Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
RuneSafe
RuneManager-OSRS
Commits
eb8d2ae0
Commit
eb8d2ae0
authored
3 years ago
by
Zlimon
Browse files
Options
Download
Email Patches
Plain Diff
Minor error handling refactor
parent
f87f0a54
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/Http/Controllers/Admin/Api/AccountController.php
+10
-2
app/Http/Controllers/Admin/Api/AccountController.php
with
10 additions
and
2 deletions
+10
-2
app/Http/Controllers/Admin/Api/AccountController.php
+
10
-
2
View file @
eb8d2ae0
...
...
@@ -146,9 +146,17 @@ public function update(Request $request, Account $account)
]);
$user
=
User
::
whereName
(
$request
->
name
)
->
orWhere
(
'id'
,
$request
->
name
)
->
pluck
(
'id'
)
->
first
();
if
(
!
$user
)
{
return
response
([
'errors'
=>
[
'name'
=>
[
'This user could not be found.'
]]],
422
);
$errors
=
[
'message'
=>
'Could not transfer account.'
,
'errors'
=>
[
'search'
=>
[
'This user could not be found.'
,
]
],
];
return
response
(
$errors
,
404
);
}
$account
->
user_id
=
$user
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets