diff --git a/backend/internal/db/mongo/item_misc.go b/backend/internal/db/mongo/item_misc.go index 8b1fb80..fa61183 100644 --- a/backend/internal/db/mongo/item_misc.go +++ b/backend/internal/db/mongo/item_misc.go @@ -75,7 +75,7 @@ func (b *Backend) GetItems(ctx context.Context, categoryID string, page, size ui if fournisseur != "" { filter["fournisseur"] = fournisseur } - + cursor, err := b.db.Collection(ItemsCollection).Find(ctx, filter, options.Find().SetSkip(int64(page*size)).SetLimit(int64(size))) if err != nil { return nil, err diff --git a/backend/internal/models/account.go b/backend/internal/models/account.go index 73abbbd..f4371df 100644 --- a/backend/internal/models/account.go +++ b/backend/internal/models/account.go @@ -32,9 +32,9 @@ func (o *Account) VerifyPin(pwd string) bool { } func (o *Account) VerifyPassword(pwd string) bool { - if (o.Account.Password != nil) { + if o.Account.Password != nil { ok, _ := hash.Verify(*o.Account.Password, pwd) - return ok + return ok } return false } diff --git a/frontend/src/lib/components/panel/modules.svelte b/frontend/src/lib/components/panel/modules.svelte index c67c598..112dddd 100644 --- a/frontend/src/lib/components/panel/modules.svelte +++ b/frontend/src/lib/components/panel/modules.svelte @@ -70,12 +70,12 @@ name: 'Fournisseur', color: 'bg-green-600', link: '/panel/products/fournisseur' - }) + }); modules.push({ - name: "Course", - color: "bg-green-600", + name: 'Course', + color: 'bg-green-600', link: '/panel/products/course' - }) + }); // Sort the modules by name modules.sort((a, b) => a.name.localeCompare(b.name)); diff --git a/frontend/src/routes/panel/products/course/+page.svelte b/frontend/src/routes/panel/products/course/+page.svelte index 1bcdae3..9edff36 100644 --- a/frontend/src/routes/panel/products/course/+page.svelte +++ b/frontend/src/routes/panel/products/course/+page.svelte @@ -4,79 +4,82 @@ import type { CourseItem, Item, RestockType } from '$lib/api'; let items: CourseItem[] = []; - let fournisseur = "promocash"; - function reloadCourse() { - CourseApi() - .getCourse(fournisseur, { - withCredentials: true - }) - .then((res) => { - if (res.data.items != null) { - items = res.data.items; - } else { - items = []; - } - }); - } - reloadCourse() + let fournisseur = 'promocash'; + function reloadCourse() { + CourseApi() + .getCourse(fournisseur, { + withCredentials: true + }) + .then((res) => { + if (res.data.items != null) { + items = res.data.items; + } else { + items = []; + } + }); + } + reloadCourse();
- - Nom - - | -- - Nombre à acheter - - | -
- {#each items as item}
- - {item.item.name} - - {/each} - |
-
- {#each items as item}
- - {item.amountToBuy} - - {/each} - |
-
+
---|---|
+ + Nom + + | ++ + Nombre à acheter + + | +
+ {#each items as item}
+ + {item.item.name} + + {/each} + |
+
+ {#each items as item}
+ + {item.amountToBuy} + + {/each} + |
+