0
0
Fork 0

Convert actions/account_notes into Typescript (#26601)

This commit is contained in:
Renaud Chaput 2023-09-11 16:09:22 +02:00 committed by GitHub
parent 7730083611
commit bd06c13204
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 148 additions and 161 deletions

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