Convert actions/account_notes
into Typescript (#26601)
This commit is contained in:
parent
7730083611
commit
bd06c13204
9 changed files with 148 additions and 161 deletions
18
app/javascript/mastodon/actions/account_notes.ts
Normal file
18
app/javascript/mastodon/actions/account_notes.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { createAppAsyncThunk } from 'mastodon/store/typed_functions';
|
||||
|
||||
import api from '../api';
|
||||
|
||||
export const submitAccountNote = createAppAsyncThunk(
|
||||
'account_note/submit',
|
||||
async (args: { id: string; value: string }, { getState }) => {
|
||||
// TODO: replace `unknown` with `ApiRelationshipJSON` when it is merged
|
||||
const response = await api(getState).post<unknown>(
|
||||
`/api/v1/accounts/${args.id}/note`,
|
||||
{
|
||||
comment: args.value,
|
||||
},
|
||||
);
|
||||
|
||||
return { relationship: response.data };
|
||||
},
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue