Skip to content

Commit

Permalink
handle photo upload on driver controller
Browse files Browse the repository at this point in the history
  • Loading branch information
roncodes committed Apr 30, 2024
1 parent f7637d3 commit e66effd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/src/Http/Controllers/Internal/v1/DriverController.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ function (&$request, &$input) {

if ($input->has('user_uuid')) {
$user = User::where('uuid', $input->get('user_uuid'))->first();
// handle `photo_uuid`
if ($user && $input->has('photo_uuid')) {
$user->update(['avatar_uuid' => $input->get('photo_uuid')]);
}
} else {
$userInput = $input
->only(['name', 'password', 'email', 'phone', 'status', 'avatar_uuid'])
Expand Down

0 comments on commit e66effd

Please sign in to comment.