pleroma/packages/pl-fe/src/actions/account-notes.ts

15 lines
563 B
TypeScript
Raw Normal View History

import { importEntities } from 'pl-fe/entity-store/actions';
import { Entities } from 'pl-fe/entity-store/entities';
import { getClient } from '../api';
2022-05-27 11:08:41 -07:00
import type { RootState } from 'pl-fe/store';
import type { AnyAction } from 'redux';
2022-05-27 11:08:41 -07:00
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)));
2022-05-27 11:08:41 -07:00
export { submitAccountNote };