mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-15 08:48:53 +00:00
[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:
7
app/javascript/flavours/glitch/api/accounts.ts
Normal file
7
app/javascript/flavours/glitch/api/accounts.ts
Normal 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,
|
||||
});
|
||||
Reference in New Issue
Block a user