Replace axios with fetch

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak
2024-05-11 23:37:37 +02:00
parent 2f57d0a5bd
commit f3165877f2
144 changed files with 1146 additions and 2754 deletions

View File

@ -17,10 +17,16 @@ function useCreateGroup() {
const api = useApi();
const { createEntity, ...rest } = useCreateEntity([Entities.GROUPS, 'search', ''], (params: CreateGroupParams) => {
return api.post('/api/v1/groups', params, {
const formData = new FormData();
Object.entries(params).forEach(([key, value]) => formData.append(key, value));
return api('/api/v1/groups', {
method: 'POST',
headers: {
'Content-Type': 'multipart/form-data',
},
body: formData,
});
}, { schema: groupSchema });