aboutsummaryrefslogtreecommitdiff
path: root/src/routes/groceries
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/groceries')
-rw-r--r--src/routes/groceries/+page.server.ts6
-rw-r--r--src/routes/groceries/catalog/+page.server.ts9
2 files changed, 6 insertions, 9 deletions
diff --git a/src/routes/groceries/+page.server.ts b/src/routes/groceries/+page.server.ts
index 1cae275..d33c6a5 100644
--- a/src/routes/groceries/+page.server.ts
+++ b/src/routes/groceries/+page.server.ts
@@ -1,4 +1,4 @@
-import { loadUnchecked, loadAll } from '$lib/server/services/groceries';
+import { groceriesService } from '$lib/server/services';
import {
addGroceryAction,
addGroceryAndEditAction,
@@ -15,8 +15,8 @@ export interface GroceriesOutput {
}
export const load: PageServerLoad = async () => {
- const unchecked = await loadUnchecked();
- const all = await loadAll();
+ const unchecked = await groceriesService.loadUnchecked();
+ const all = await groceriesService.loadAll();
return {
items: unchecked.items,
categories: unchecked.categories,
diff --git a/src/routes/groceries/catalog/+page.server.ts b/src/routes/groceries/catalog/+page.server.ts
index fd71e30..8d94154 100644
--- a/src/routes/groceries/catalog/+page.server.ts
+++ b/src/routes/groceries/catalog/+page.server.ts
@@ -1,8 +1,5 @@
import { fail } from '@sveltejs/kit';
-import {
- loadAll,
- bulkUpdateGroceryCategory,
-} from '$lib/server/services/groceries';
+import { groceriesService } from '$lib/server/services';
import { toggleGroceryAction } from '$lib/server/services/grocery-actions';
import {
numericId,
@@ -18,7 +15,7 @@ export interface CatalogOutput {
}
export const load: PageServerLoad = async () => {
- return loadAll();
+ return groceriesService.loadAll();
};
export const actions: Actions = {
@@ -34,7 +31,7 @@ export const actions: Actions = {
return fail(400, { error: 'Aucun article sélectionné' });
}
- await bulkUpdateGroceryCategory(ids, categoryId);
+ await groceriesService.bulkUpdateGroceryCategory(ids, categoryId);
return { success: true, type: 'bulkUpdate' as const };
},
};