Revert "merge 1"

This reverts commit 0bc6c20a6d.
This commit is contained in:
2022-10-24 01:03:43 +01:00
parent 0bc6c20a6d
commit 0c463d1f10
166 changed files with 1849 additions and 4266 deletions

View File

@@ -21,10 +21,7 @@
namespace App\Observers;
use App\Exceptions\ProfileAlreadyExistsException;
use App\Exceptions\ProfileCreationFailedException;
use App\Profile;
use App\Services\ProfileService;
use App\User;
use Illuminate\Support\Facades\Log;
@@ -43,24 +40,15 @@ class UserObserver
*/
public function created(User $user)
{
$profileService = new ProfileService();
// TODO: Make sure that the profile is created, throw an exception if otherwise, or try to recreate the profile.
Profile::create([
try
{
$profileService->createProfile($user);
}
catch (ProfileAlreadyExistsException $exception)
{
Log::error('Attempting to create profile that already exists!', [
'trace' => $exception->getTrace()
]);
}
catch (ProfileCreationFailedException $e)
{
Log::error('Failed creating a new profile!', [
'trace' => $e->getTrace()
]);
}
'profileShortBio' => 'Write a one-liner about you here!',
'profileAboutMe' => 'Tell us a bit about you.',
'socialLinks' => '{}',
'userID' => $user->id,
]);
}
/**