Renaud Chaput 8d6058b40a [Glitch] Proposal: a modern & typed way of writing Redux actions doing API requests
Port 10ec421dd4e0da987e69a3dd7f4f696f9c5878e0 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2024-05-23 20:33:05 +02:00

8 lines
303 B
TypeScript

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,
});