feat: change avatar management (#2112)
This commit is contained in:
committed by
Alexis Saettler
parent
25fa60911a
commit
72ff0d3da4
@@ -9,6 +9,7 @@ use App\Http\Controllers\Controller;
|
||||
use App\Traits\JsonRespondController;
|
||||
use App\Services\Account\Photo\UploadPhoto;
|
||||
use App\Services\Account\Photo\DestroyPhoto;
|
||||
use App\Services\Contact\Avatar\UpdateAvatar;
|
||||
use App\Http\Resources\Photo\Photo as PhotoResource;
|
||||
|
||||
class PhotosController extends Controller
|
||||
@@ -72,5 +73,14 @@ class PhotosController extends Controller
|
||||
} catch (\Exception $e) {
|
||||
return $this->respondNotFound();
|
||||
}
|
||||
|
||||
if ($contact->avatar_source == 'photo'
|
||||
&& $contact->avatar_photo_id == $photo->id) {
|
||||
app(UpdateAvatar::class)->execute([
|
||||
'account_id' => auth()->user()->account->id,
|
||||
'contact_id' => $contact->id,
|
||||
'source' => 'adorable',
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user