order item
This commit is contained in:
@@ -6,6 +6,7 @@ import type {
|
||||
FieldResponseType,
|
||||
FieldValueDetailResponseType,
|
||||
FieldValuesResponseType,
|
||||
GetEnitityFieldResponseType,
|
||||
} from "../types/Types";
|
||||
|
||||
export const createField = async (id: number, params: CreateFieldType) => {
|
||||
@@ -15,14 +16,14 @@ export const createField = async (id: number, params: CreateFieldType) => {
|
||||
|
||||
export const getFields = async (id: number) => {
|
||||
const { data } = await axios.get<FieldResponseType>(
|
||||
`/admin/entity/${id}/field`,
|
||||
`/admin/entity/${id}/field`
|
||||
);
|
||||
return data;
|
||||
};
|
||||
|
||||
export const getFieldDetail = async (id: number) => {
|
||||
const { data } = await axios.get<FieldDetailResponseType>(
|
||||
`/admin/entity/field/${id}`,
|
||||
`/admin/entity/field/${id}`
|
||||
);
|
||||
return data;
|
||||
};
|
||||
@@ -39,14 +40,14 @@ export const deleteFields = async (id: number) => {
|
||||
|
||||
export const getFieldValues = async (id: number) => {
|
||||
const { data } = await axios.get<FieldValuesResponseType>(
|
||||
`/admin/entity/field/${id}/option`,
|
||||
`/admin/entity/field/${id}/option`
|
||||
);
|
||||
return data;
|
||||
};
|
||||
|
||||
export const createFieldValues = async (
|
||||
id: number,
|
||||
params: CreateFieldValueType,
|
||||
params: CreateFieldValueType
|
||||
) => {
|
||||
const { data } = await axios.post(`/admin/entity/field/${id}/option`, params);
|
||||
return data;
|
||||
@@ -54,18 +55,18 @@ export const createFieldValues = async (
|
||||
|
||||
export const updateFieldValues = async (
|
||||
id: number,
|
||||
params: CreateFieldValueType,
|
||||
params: CreateFieldValueType
|
||||
) => {
|
||||
const { data } = await axios.patch(
|
||||
`/admin/entity/field/option/${id}`,
|
||||
params,
|
||||
params
|
||||
);
|
||||
return data;
|
||||
};
|
||||
|
||||
export const getFieldValueDetail = async (id: number) => {
|
||||
const { data } = await axios.get<FieldValueDetailResponseType>(
|
||||
`/admin/entity/field/option/${id}`,
|
||||
`/admin/entity/field/option/${id}`
|
||||
);
|
||||
return data;
|
||||
};
|
||||
@@ -74,3 +75,10 @@ export const deleteFieldValue = async (id: number) => {
|
||||
const { data } = await axios.delete(`/admin/entity/field/option/${id}`);
|
||||
return data;
|
||||
};
|
||||
|
||||
export const getEntityField = async (entityId: number) => {
|
||||
const { data } = await axios.get<GetEnitityFieldResponseType>(
|
||||
`/admin/entity/${entityId}/field`
|
||||
);
|
||||
return data;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user