mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 11:59:23 +00:00
Apply review comments
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import { exportToHtml } from "#core:utils/globals";
|
||||
import { BasketItem } from "#counter:counter/basket";
|
||||
import type { CounterConfig } from "#counter:counter/types";
|
||||
import type { CounterConfig, ErrorMessage } from "#counter:counter/types";
|
||||
|
||||
exportToHtml("loadCounter", (config: CounterConfig) => {
|
||||
document.addEventListener("alpine:init", () => {
|
||||
@ -38,7 +38,7 @@ exportToHtml("loadCounter", (config: CounterConfig) => {
|
||||
delete this.basket[id];
|
||||
},
|
||||
|
||||
addToBasket(id: string, quantity: number): string {
|
||||
addToBasket(id: string, quantity: number): ErrorMessage {
|
||||
const item: BasketItem =
|
||||
this.basket[id] || new BasketItem(config.products[id], 0);
|
||||
|
||||
|
2
counter/static/bundled/counter/types.d.ts
vendored
2
counter/static/bundled/counter/types.d.ts
vendored
@ -1,3 +1,5 @@
|
||||
type ErrorMessage = string;
|
||||
|
||||
export interface InitialFormData {
|
||||
/* Used to refill the form when the backend raises an error */
|
||||
id?: keyof Record<string, Product>;
|
||||
|
Reference in New Issue
Block a user