import { axiosInstance, ApiBase } from "./common";
import { MACHINES_API_URL } from "../const";

const baseUrl = `${MACHINES_API_URL}/machines`;

class MachinesApi extends ApiBase {
    list = async () => {
        return axiosInstance.get(`${baseUrl}`, {});
    };
    get = async (machineId) => {
        return axiosInstance.get(`${baseUrl}/${machineId}`, {});
    };
    listProducts = async (machineId) => {
        return axiosInstance.get(`${baseUrl}/${machineId}/products`, {});
    };
}

export const machinesApi = new MachinesApi();
