Files
mixtape/zero.Backoffice.UI/app/modules/spaces/api.ts
T
2021-12-19 14:18:16 +01:00

23 lines
1.1 KiB
TypeScript

import { get, post, put, del, ApiRequestConfig, ApiRequestQuery } from '../../services/request';
export default {
getTypes: (config?: ApiRequestConfig) => get('spaces/types', { ...config }),
getType: (alias: string, config?: ApiRequestConfig) => get('spaces/types/' + alias, { ...config }),
getByAlias: (alias: string, query?: ApiRequestQuery, config?: ApiRequestConfig) => get('spaces/' + alias, { ...config, params: { ...(query || {}) }}),
getEmpty: (alias: string, config?: ApiRequestConfig) => get("spaces/empty", { ...config, params: { alias } }),
//getById: (id: string, changeVector?: string, config?: ApiRequestConfig) => get('countries/' + id, { ...config, params: { changeVector } }),
//getByQuery: (query: ApiRequestQuery, config?: ApiRequestConfig) => get('countries', { ...config, params: { ...query } }),
//create: (model: any, config?: ApiRequestConfig) => post('countries', model, config),
//update: (model: any, config?: ApiRequestConfig) => put('countries/' + model.id, model, config),
//delete: (id: string, config?: ApiRequestConfig) => del('countries/' + id, null, config),
};