feat: change avatar management (#2112)

This commit is contained in:
Regis Freyd
2019-08-17 21:32:10 +02:00
committed by Alexis Saettler
parent 25fa60911a
commit 72ff0d3da4
89 changed files with 2749 additions and 719 deletions
@@ -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',
]);
}
}
}