mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim.git
synced 2026-08-19 04:24:00 +00:00
user invitations fix
This commit is contained in:
@@ -49,7 +49,6 @@ class CreateAccountInvitationLogic
|
||||
|
||||
|
||||
$invitation = $this->createUserInvitation->execute($object);
|
||||
|
||||
event(new UserInvited($invitation));
|
||||
|
||||
return new JsonResponse("Invitation have been sent!", HttpStatus::RESOURCE_CREATED);
|
||||
|
||||
@@ -21,7 +21,7 @@ class UserHasRegistered implements UserEvent {
|
||||
/**
|
||||
* @return User
|
||||
*/
|
||||
public function getUser(): User {
|
||||
public function getData(): User {
|
||||
return $this->user;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,17 +17,17 @@ class UserEventHandler {
|
||||
public function handle(UserEvent $event): void {
|
||||
|
||||
if ($event instanceof UserHasRegistered) {
|
||||
$attempts = UserEmailVerification::where('email', $event->getUser()->email);
|
||||
$attempts = UserEmailVerification::where('email', $event->getData()->email);
|
||||
|
||||
if ($attempts !== null && !$event->getUser()->hasVerifiedEmail()) {
|
||||
$event->getUser()->notify(new VerifyEmail($attempts->first()));
|
||||
if ($attempts !== null && !$event->getData()->hasVerifiedEmail()) {
|
||||
$event->getData()->notify(new VerifyEmail($attempts->first()));
|
||||
$attempts->first()->update(['is_sent' => true]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ($event instanceof UserInvited) {
|
||||
$event->getInvitation()->notify(new InvitationEmail($event));
|
||||
$event->getData()->notify(new InvitationEmail($event));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ class InvitationEmail extends AbstractEmail
|
||||
|
||||
/**
|
||||
* InvitationEmail constructor.
|
||||
* @param UserInvited $invitationt
|
||||
* @param UserInvited $invitation
|
||||
*/
|
||||
public function __construct(UserInvited $invitation) {
|
||||
$this->invitation = $invitation;
|
||||
@@ -29,11 +29,11 @@ class InvitationEmail extends AbstractEmail
|
||||
}
|
||||
|
||||
private function invitationUrl(){
|
||||
return url(route('auth.registration', ['email' => $this->invitation->getInvitation()->email, 'hash' => $this->invitation->getInvitation()->hash]));
|
||||
return url(route('auth.registration', ['email' => $this->invitation->getData()->email, 'hash' => $this->invitation->getData()->hash]));
|
||||
}
|
||||
|
||||
private function senderName(){
|
||||
$sender = $this->invitation->getInvitation()->sender;
|
||||
$sender = $this->invitation->getData()->sender;
|
||||
return $sender->first_name.' '.$sender->last_name;
|
||||
}
|
||||
|
||||
|
||||
Vendored
+2
@@ -35,6 +35,7 @@ Vue.component('address-component', require('./components/form_elements/AddressCo
|
||||
|
||||
//lists
|
||||
Vue.component('accounts-list-component', require('./components/account/lists/AccountsListComponent.vue'));
|
||||
Vue.component('invite-account-list-component', require('./components/account/lists/AccountsInviteListComponent.vue'));
|
||||
|
||||
|
||||
Vue.component('companies-list-component', require('./components/company/lists/CompaniesListComponenet.vue'));
|
||||
@@ -49,6 +50,7 @@ Vue.component('orders-list-component', require('./components/order/lists/OrdersL
|
||||
//elements
|
||||
|
||||
Vue.component('account-component', require('./components/account/elements/AccountComponent.vue'));
|
||||
Vue.component('invite-account-component', require('./components/account/elements/AccountInviteComponent.vue'));
|
||||
|
||||
Vue.component('company-profile-component', require('./components/company/elements/CompanyProfileComponenet.vue'));
|
||||
Vue.component('company-summary-component', require('./components/company/elements/CompanySummaryComponenet.vue'));
|
||||
|
||||
Reference in New Issue
Block a user