petalbid-frontend
    Preparing search index...

    Variable productServiceConst

    productService: {
        createProduct: (data: ProductDto) => Promise<ApiResponse<Product>>;
        deleteProduct: (id: number) => Promise<ApiResponse<null>>;
        getMyProducts: (
            opts?: { force?: boolean },
        ) => Promise<ApiResponse<Product[]>>;
        getProductHistory: (id: number) => Promise<ApiResponse<ProductHistory>>;
        updateProduct: (
            id: number,
            data: ProductDto,
        ) => Promise<ApiResponse<Product>>;
    } = ...

    Service for handling product-related API calls with caching.

    Type Declaration

    • createProduct: (data: ProductDto) => Promise<ApiResponse<Product>>

      Creates a new product and invalidates cache.

    • deleteProduct: (id: number) => Promise<ApiResponse<null>>

      Deletes a product and invalidates cache.

    • getMyProducts: (opts?: { force?: boolean }) => Promise<ApiResponse<Product[]>>

      Fetches all products. Uses cache unless forced.

    • getProductHistory: (id: number) => Promise<ApiResponse<ProductHistory>>

      Fetches the price history for a specific product ID.

    • updateProduct: (id: number, data: ProductDto) => Promise<ApiResponse<Product>>

      Updates an existing product and invalidates cache.