pleroma/packages/pl-fe/src/actions/account-notes.ts
marcin mikołajczak 1d26e6f6aa pl-fe: relationship entities handling cleanup
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-09-28 22:34:50 +02:00

14 lines
563 B
TypeScript

import { importEntities } from 'pl-fe/entity-store/actions';
import { Entities } from 'pl-fe/entity-store/entities';
import { getClient } from '../api';
import type { RootState } from 'pl-fe/store';
import type { AnyAction } from 'redux';
const submitAccountNote = (accountId: string, value: string) =>
(dispatch: React.Dispatch<AnyAction>, getState: () => RootState) =>
getClient(getState).accounts.updateAccountNote(accountId, value)
.then(response => dispatch(importEntities([response], Entities.RELATIONSHIPS)));
export { submitAccountNote };