Proposal: a modern & typed way of writing Redux actions doing API requests (#30270)
This commit is contained in:
parent
3a862439df
commit
10ec421dd4
14 changed files with 281 additions and 125 deletions
7
app/javascript/mastodon/api/accounts.ts
Normal file
7
app/javascript/mastodon/api/accounts.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
import { apiRequest } from 'mastodon/api';
|
||||
import type { ApiRelationshipJSON } from 'mastodon/api_types/relationships';
|
||||
|
||||
export const apiSubmitAccountNote = (id: string, value: string) =>
|
||||
apiRequest<ApiRelationshipJSON>('post', `/api/v1/accounts/${id}/note`, {
|
||||
comment: value,
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue