[Glitch] Change apiRequest to accept both params and data

Port 547e97945d
This commit is contained in:
Renaud Chaput
2024-06-25 15:45:41 +02:00
committed by Claire
parent 6f2771cb32
commit 3a20290915
4 changed files with 51 additions and 12 deletions

View File

@@ -1,7 +1,9 @@
import { apiRequest } from 'flavours/glitch/api';
import { apiRequestPost } from 'flavours/glitch/api';
import type { ApiRelationshipJSON } from 'flavours/glitch/api_types/relationships';
export const apiSubmitAccountNote = (id: string, value: string) =>
apiRequest<ApiRelationshipJSON>('post', `v1/accounts/${id}/note`, {
comment: value,
apiRequestPost<ApiRelationshipJSON>(`v1/accounts/${id}/note`, {
data: {
comment: value,
},
});