mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 12:58:13 +00:00
rule engine UI, services and API integration
This commit is contained in:
@@ -1,5 +1,25 @@
|
||||
// import { CargoType } from "@edr-freight-web/types";
|
||||
// import { api as client } from "@edr-freight-web/utils/api/";
|
||||
import { api as client } from "../../auth/http";
|
||||
import { URL_CONSTANTS } from "../../constants/URLS";
|
||||
|
||||
export const createCargoType = (data: any) => {
|
||||
|
||||
return client.post(URL_CONSTANTS.RULE_ENGINE.CARGO_TYPES, { data });
|
||||
};
|
||||
|
||||
|
||||
export const getCargoType = () => {
|
||||
return client.get(URL_CONSTANTS.RULE_ENGINE.CARGO_TYPES);
|
||||
};
|
||||
|
||||
export const getCargoTypeById = (id: string) => {
|
||||
return client.get(`${URL_CONSTANTS.RULE_ENGINE.CARGO_TYPES}/${id}`);
|
||||
};
|
||||
|
||||
export const updateCargoType = (id: string, data: any) => {
|
||||
return client.put(`${URL_CONSTANTS.RULE_ENGINE.CARGO_TYPES}/${id}`, { data });
|
||||
};
|
||||
|
||||
|
||||
export const deleteCargoType = (id: string) => {
|
||||
return client.delete(`${URL_CONSTANTS.RULE_ENGINE.CARGO_TYPES}/${id}`);
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
import { api as client } from "../../auth/http";
|
||||
import { URL_CONSTANTS } from "../../constants/URLS";
|
||||
|
||||
export const createContainerType = (data: any) =>
|
||||
client.post(URL_CONSTANTS.RULE_ENGINE.CONTAINER_TYPES, { data });
|
||||
|
||||
export const getContainerTypes = () =>
|
||||
client.get(URL_CONSTANTS.RULE_ENGINE.CONTAINER_TYPES);
|
||||
|
||||
export const getContainerTypeById = (id: string) =>
|
||||
client.get(URL_CONSTANTS.RULE_ENGINE.CONTAINER_TYPE_BY_ID(id));
|
||||
|
||||
|
||||
|
||||
export const updateContainerType = (id: string, data: any) =>
|
||||
client.put(URL_CONSTANTS.RULE_ENGINE.CONTAINER_TYPE_BY_ID(id), { data });
|
||||
|
||||
export const deleteContainerType = (id: string) =>
|
||||
client.delete(URL_CONSTANTS.RULE_ENGINE.CONTAINER_TYPE_BY_ID(id));
|
||||
Reference in New Issue
Block a user