import type { GeneralConditions, GeneralConditionsType } from '@entities' import type { HttpClient } from '@services' import type { ApiError, Response } from '@types' import { toGeneralConditionsType } from './toGeneralConditionsType' export type CreateGeneralConditionsInput = { terms_and_condition: { content: { fr: string en: string } } type: GeneralConditionsType } const createGeneralConditions = (http: HttpClient) => ({ query: ({ type, ...input }: CreateGeneralConditionsInput): Promise< Response > => { return http.post(`v3/admin/${toGeneralConditionsType(type)}`, input) }, }) export default createGeneralConditions