Fixes for unsubscribe routes

This commit is contained in:
David Bomba 2022-03-06 18:06:07 +11:00
parent c65948d10c
commit a4615a331d
12 changed files with 15 additions and 15 deletions

View File

@ -264,17 +264,17 @@ class InvitationController extends Controller
abort(404, "Invoice not found");
}
public function unsubscribe(Request $request, string $entity_type, string $invitation_key)
public function unsubscribe(Request $request, string $entity, string $invitation_key)
{
if($entity_type == 'invoice'){
if($entity == 'invoice'){
$invite = InvoiceInvitation::withTrashed()->where('key', $invitation_key)->first();
$invite->contact->send_email = false;
$invite->contact->save();
}elseif($entity_type == 'quote'){
}elseif($entity == 'quote'){
$invite = QuoteInvitation::withTrashed()->where('key', $invitation_key)->first();
$invite->contact->send_email = false;
$invite->contact->save();
}elseif($entity_type == 'credit'){
}elseif($entity == 'credit'){
$invite = CreditInvitation::withTrashed()->where('key', $invitation_key)->first();
$invite->contact->send_email = false;
$invite->contact->save();

View File

@ -36,7 +36,7 @@ class PaymentTransformer extends BaseTransformer
}
$transformed = [
'company_id' => $this->maps['company']->id,
'company_id' => $this->company->id,
'number' => $this->getString($data, 'payment.number'),
'user_id' => $this->getString($data, 'payment.user_id'),
'amount' => $this->getFloat($data, 'payment.amount'),

View File

@ -175,7 +175,7 @@
}
#table-totals > .totals-table-right-side > * > :nth-child(1) {
text-align: "$dir_text_align";
text-align: $dir_text_align;
margin-top: .75rem;
}

View File

@ -179,7 +179,7 @@
}
#table-totals>.totals-table-right-side>*> :nth-child(1) {
text-align: "$dir_text_align";
text-align: $dir_text_align;
margin-top: .75rem;
padding-left: 7px;
}

View File

@ -156,7 +156,7 @@
}
#table-totals>.totals-table-right-side>*> :nth-child(1) {
text-align: "$dir_text_align";
text-align: $dir_text_align;
margin-top: .75rem;
}

View File

@ -148,7 +148,7 @@
}
#table-totals>.totals-table-right-side>*> :nth-child(1) {
text-align: "$dir_text_align";
text-align: $dir_text_align;
margin-top: .75rem;
}

View File

@ -152,7 +152,7 @@
}
#table-totals>.totals-table-right-side>*> :nth-child(1) {
text-align: "$dir_text_align";
text-align: $dir_text_align;
margin-top: .75rem;
}

View File

@ -159,7 +159,7 @@
}
#table-totals>.totals-table-right-side>*> :nth-child(1) {
text-align: "$dir_text_align";
text-align: $dir_text_align;
margin-top: .75rem;
}

View File

@ -126,7 +126,7 @@
}
#table-totals>.totals-table-right-side>*> :nth-child(1) {
text-align: "$dir_text_align";
text-align: $dir_text_align;
margin-top: .25rem;
padding-left: 7px;
}

View File

@ -174,7 +174,7 @@
}
#table-totals>.totals-table-right-side>*> :nth-child(1) {
text-align: "$dir_text_align";
text-align: $dir_text_align;
margin-top: .75rem;
}

View File

@ -185,7 +185,7 @@
}
#table-totals>.totals-table-right-side>*> :nth-child(1) {
text-align: "$dir_text_align";
text-align: $dir_text_align;
padding: 7px;
}

View File

@ -114,7 +114,7 @@ Route::group(['middleware' => ['invite_db'], 'prefix' => 'client', 'as' => 'clie
Route::get('{entity}/{invitation_key}/download', 'ClientPortal\InvitationController@routerForDownload');
Route::get('pay/{invitation_key}', 'ClientPortal\InvitationController@payInvoice')->name('pay.invoice');
Route::get('unsubscribe/{entity_type}/{invitation_key}', 'ClientPortal\InvitationController@unsubscribe')->name('unsubscribe');
Route::get('unsubscribe/{entity}/{invitation_key}', 'ClientPortal\InvitationController@unsubscribe')->name('unsubscribe');
// Route::get('{entity}/{client_hash}/{invitation_key}', 'ClientPortal\InvitationController@routerForIframe')->name('invoice.client_hash_and_invitation_key'); //should never need this