mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-24 13:58:06 +01:00
7fe5623a27
Port 3bf2a7296e
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
18 lines
549 B
TypeScript
18 lines
549 B
TypeScript
import type { ApiRelationshipJSON } from 'flavours/glitch/api_types/relationships';
|
|
import { createAppAsyncThunk } from 'flavours/glitch/store/typed_functions';
|
|
|
|
import api from '../api';
|
|
|
|
export const submitAccountNote = createAppAsyncThunk(
|
|
'account_note/submit',
|
|
async (args: { id: string; value: string }, { getState }) => {
|
|
const response = await api(getState).post<ApiRelationshipJSON>(
|
|
`/api/v1/accounts/${args.id}/note`,
|
|
{
|
|
comment: args.value,
|
|
},
|
|
);
|
|
|
|
return { relationship: response.data };
|
|
},
|
|
);
|