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',
|
2024-05-23 00:45:18 +10:00
|
|
|
async (args: { id: string; value: string }) => {
|
|
|
|
const response = await api().post<ApiRelationshipJSON>(
|
2023-09-12 00:09:22 +10:00
|
|
|
`/api/v1/accounts/${args.id}/note`,
|
|
|
|
{
|
|
|
|
comment: args.value,
|
|
|
|
},
|
|
|
|
);
|
|
|
|
|
|
|
|
return { relationship: response.data };
|
|
|
|
},
|
|
|
|
);
|