import { AxiosResponse } from 'axios' ; import { APIRequest } from '@/network/APIRequest' ; import { HTTPMethod } from '@/network/APIClient' ; import { IProduct , IProductsCriteria } from '@/entities/Product' ; export namespace ProductAPI { export class GetProducts implements APIRequest < List < IProduct > > { response : List < IProduct > ; path = '/api/products' ; method = HTTPMethod . GET ; parse = ( data ) => data . data ; constructor ( public params ) { } } export class GetProduct implements APIRequest < IProduct > { response : IProduct ; path : string ; method = HTTPMethod . GET ; parse = ( data ) => data . data ; constructor ( id ) { this . path = `/api/products/${ id }` ; } } }