mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
node api
This commit is contained in:
parent
cad4e683bc
commit
a662256221
4 changed files with 27 additions and 3 deletions
15
src/redux/node/api.ts
Normal file
15
src/redux/node/api.ts
Normal file
|
@ -0,0 +1,15 @@
|
|||
import { api, configWithToken, resultMiddleware, errorMiddleware } from '~/utils/api';
|
||||
import { INode } from '../types';
|
||||
import { API } from '~/constants/api';
|
||||
|
||||
export const postNode = ({
|
||||
access,
|
||||
data,
|
||||
}: {
|
||||
access: string,
|
||||
data: INode,
|
||||
}) => (
|
||||
api.post(API.NODE.SAVE, { data }, configWithToken(access))
|
||||
.then(resultMiddleware)
|
||||
.catch(errorMiddleware)
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue