moved to default subscription in editform
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
import { applyAction, enhance } from '$app/forms';
|
import { applyAction, enhance } from '$app/forms';
|
||||||
import { receive, send } from '$lib/utils/helpers';
|
import { receive, send } from '$lib/utils/helpers';
|
||||||
import { t } from 'svelte-i18n';
|
import { t } from 'svelte-i18n';
|
||||||
|
import { defaultSubscription } from '$lib/utils/defaults';
|
||||||
|
|
||||||
const dispatch = createEventDispatcher();
|
const dispatch = createEventDispatcher();
|
||||||
|
|
||||||
@@ -17,20 +18,8 @@
|
|||||||
/** @type {App.Types['subscription'] | null} */
|
/** @type {App.Types['subscription'] | null} */
|
||||||
export let subscription;
|
export let subscription;
|
||||||
|
|
||||||
/** @type {App.Types['subscription']} */
|
|
||||||
const blankSubscription = {
|
|
||||||
id: 0,
|
|
||||||
name: '',
|
|
||||||
details: '',
|
|
||||||
conditions: '',
|
|
||||||
monthly_fee: 0,
|
|
||||||
hourly_rate: 0,
|
|
||||||
included_hours_per_year: 0,
|
|
||||||
included_hours_per_month: 0
|
|
||||||
};
|
|
||||||
|
|
||||||
console.log('Opening subscription modal with:', subscription);
|
console.log('Opening subscription modal with:', subscription);
|
||||||
$: subscription = subscription || { ...blankSubscription };
|
$: subscription = subscription || { ...defaultSubscription() };
|
||||||
$: isLoading = subscription === undefined || user === undefined;
|
$: isLoading = subscription === undefined || user === undefined;
|
||||||
let isUpdating = false;
|
let isUpdating = false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user