1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Merge pull request #5712 from turbo124/v5-develop

Minor fixes for subscription URL spec
This commit is contained in:
David Bomba 2021-05-15 14:50:26 +10:00 committed by GitHub
commit a34fbe9121
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 16 deletions

View File

@ -370,7 +370,7 @@ class CompanyExport implements ShouldQueue
})->makeHidden(['id'])->toArray();
$this->export_data['users'] = $this->company->users->map(function ($user){
$this->export_data['users'] = $this->company->users()->withTrashed()->cursor()->map(function ($user){
$user->account_id = $this->encodePrimaryKey($user->account_id);
$user->id = $this->encodePrimaryKey($user->id);

View File

@ -60,7 +60,7 @@ class SubscriptionTransformer extends EntityTransformer
'allow_plan_changes' => (bool)$subscription->allow_plan_changes,
'refund_period' => (int)$subscription->refund_period,
'webhook_configuration' => $subscription->webhook_configuration ?: [],
'purchase_page' => (string)$company->domain() . "/client/subscription/{$subscription->hashed_id}/purchase",
'purchase_page' => (string)$company->domain() . "/client/subscriptions/{$subscription->hashed_id}/purchase",
//'purchase_page' => (string)route('client.subscription.purchase', $subscription->hashed_id),
'currency_id' => (string) $subscription->currency_id,
'is_deleted' => (bool)$subscription->is_deleted,

View File

@ -80,7 +80,7 @@ Route::group(['middleware' => ['auth:contact', 'locale', 'check_client_existence
Route::get('logout', 'Auth\ContactLoginController@logout')->name('logout');
});
Route::get('client/subscription/{subscription}/purchase', 'ClientPortal\SubscriptionPurchaseController@index')->name('client.subscription.purchase')->middleware('domain_db');
Route::get('client/subscriptions/{subscription}/purchase', 'ClientPortal\SubscriptionPurchaseController@index')->name('client.subscription.purchase')->middleware('domain_db');
Route::group(['middleware' => ['invite_db'], 'prefix' => 'client', 'as' => 'client.'], function () {
/*Invitation catches*/

View File

@ -16,6 +16,7 @@ use App\Models\Expense;
use App\Models\Invoice;
use App\Models\Payment;
use App\Models\Product;
use App\Models\User;
use App\Models\Vendor;
use App\Utils\Traits\MakesHash;
use Illuminate\Routing\Middleware\ThrottleRequests;
@ -63,23 +64,28 @@ class ImportCompanyTest extends TestCase
$this->assertTrue(property_exists($backup_json_file, 'app_version'));
$this->assertTrue(property_exists($backup_json_file, 'users'));
// User::unguard();
User::unguard();
// foreach ($this->backup_file->users as $user)
// {
foreach ($backup_json_file->users as $user)
{
// $new_user = User::firstOrNew(
// ['email' => $user->email],
// (array)$user,
// );
$new_user = User::firstOrNew(
['email' => $user->email],
(array)$user,
);
// $new_user->account_id = $this->account->id;
// $new_user->save(['timestamps' => false]);
$new_user->account_id = $this->account->id;
$new_user->save(['timestamps' => false]);
// $this->ids['users']["{$user->id}"] = $new_user->id;
// }
nlog($new_user->toArray());
// User::reguard();
$this->ids['users']["{$user->id}"] = $new_user->id;
nlog($this->ids);
}
User::reguard();
}

File diff suppressed because one or more lines are too long