fix: add constraint actions to db structure
This commit adds several missing "cascade delete" actions to relationships on database tables. This effectively fixes errors while trying to delete user accounts because of pending child records. Additionally, the observers for applications and vacancies were removed, since they are now obsolete. The account deletion system was also refactored.
This commit is contained in:
@@ -30,27 +30,23 @@ class UserAccountDeleteConfirmation extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
public $deleteToken;
|
||||
public string
|
||||
$approveLink,
|
||||
$cancelLink,
|
||||
$name,
|
||||
$userID;
|
||||
|
||||
public $cancelToken;
|
||||
|
||||
public $originalIP;
|
||||
|
||||
public $name;
|
||||
|
||||
public $userID;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user, array $tokens, string $originalIP)
|
||||
public function __construct(User $user, array $links)
|
||||
{
|
||||
$this->deleteToken = $tokens['delete'];
|
||||
$this->cancelToken = $tokens['cancel'];
|
||||
$this->approveLink = $links['approveURL'];
|
||||
$this->cancelLink = $links['cancelURL'];
|
||||
|
||||
$this->originalIP = $originalIP;
|
||||
$this->name = $user->name;
|
||||
$this->userID = $user->id;
|
||||
}
|
||||
@@ -62,6 +58,7 @@ class UserAccountDeleteConfirmation extends Mailable
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
return $this->view('mail.deleted-account');
|
||||
return $this->subject('[ACTION REQUIRED] Please confirm account removal')
|
||||
->view('mail.deleted-account');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user