2023-11-04 02:00:03 +11:00
|
|
|
import type { ApiRelationshipJSON } from 'mastodon/api_types/relationships';
|
2023-09-12 00:09:22 +10:00
|
|
|
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 }) => {
|
2023-11-04 02:00:03 +11:00
|
|
|
const response = await api(getState).post<ApiRelationshipJSON>(
|
2023-09-12 00:09:22 +10:00
|
|
|
`/api/v1/accounts/${args.id}/note`,
|
|
|
|
{
|
|
|
|
comment: args.value,
|
|
|
|
},
|
|
|
|
);
|
|
|
|
|
|
|
|
return { relationship: response.data };
|
|
|
|
},
|
|
|
|
);
|