[Glitch] Proposal: a modern & typed way of writing Redux actions doing API requests

Port 10ec421dd4 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Renaud Chaput
2024-05-23 11:50:13 +02:00
committed by Claire
parent 51631c785f
commit 8d6058b40a
14 changed files with 281 additions and 125 deletions

View File

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