2021-12-19 14:18:16 +01:00
|
|
|
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 || {}) }}),
|
|
|
|
|
|
2022-01-12 11:39:32 +01:00
|
|
|
getEmpty: (alias: string, config?: ApiRequestConfig) => get("spaces/" + alias + "/empty", { ...config }),
|
2021-12-19 14:18:16 +01:00
|
|
|
|
2022-01-12 11:39:32 +01:00
|
|
|
getById: (alias: string, id: string, config?: ApiRequestConfig) => get("spaces/" + alias + "/" + id, { ...config }),
|
2021-12-19 14:18:16 +01:00
|
|
|
|
2022-01-12 11:39:32 +01:00
|
|
|
create: (model: any, config?: ApiRequestConfig) => post('spaces', model, config),
|
2021-12-19 14:18:16 +01:00
|
|
|
|
2022-01-12 11:39:32 +01:00
|
|
|
update: (model: any, config?: ApiRequestConfig) => put('spaces/' + model.id, model, config),
|
2021-12-19 14:18:16 +01:00
|
|
|
|
2022-01-12 11:39:32 +01:00
|
|
|
delete: (id: string, config?: ApiRequestConfig) => del('spaces/' + id, null, config),
|
2021-12-19 14:18:16 +01:00
|
|
|
};
|