Files
mixtape/zero.Backoffice.UI/app/modules/countries/api.ts
T

16 lines
784 B
TypeScript
Raw Normal View History

2021-12-14 11:54:36 +01:00
import { get, post, put, del, ApiRequestConfig, ApiRequestQuery } from '../../services/request';
2021-12-07 15:59:29 +01:00
export default {
getEmpty: (flavor?: string, config?: ApiRequestConfig) => get("countries/empty", { ...config, params: { flavor } }),
2021-12-07 15:59:29 +01:00
getById: (id: string, changeVector?: string, config?: ApiRequestConfig) => get('countries/' + id, { ...config, params: { changeVector } }),
2021-12-07 15:59:29 +01:00
getByQuery: (query: ApiRequestQuery, config?: ApiRequestConfig) => get('countries', { ...config, params: { ...query } }),
2021-12-07 15:59:29 +01:00
create: (model: any, config?: ApiRequestConfig) => post('countries', model, config),
2021-12-07 15:59:29 +01:00
update: (model: any, config?: ApiRequestConfig) => put('countries/' + model.id, model, config),
2021-12-07 15:59:29 +01:00
2021-12-16 16:59:27 +01:00
delete: (id: string, config?: ApiRequestConfig) => del('countries/' + id, null, config),
2021-12-07 15:59:29 +01:00
};