1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 04:46:40 +07:00
This commit is contained in:
muerwre 2019-08-22 21:08:42 +07:00
parent a662256221
commit 148974ab7d
8 changed files with 56 additions and 9 deletions

View file

@ -1,15 +1,15 @@
import { api, configWithToken, resultMiddleware, errorMiddleware } from '~/utils/api';
import { INode } from '../types';
import { INode, IResultWithStatus } from '../types';
import { API } from '~/constants/api';
export const postNode = ({
access,
data,
node,
}: {
access: string,
data: INode,
}) => (
api.post(API.NODE.SAVE, { data }, configWithToken(access))
node: INode,
}): Promise<IResultWithStatus<INode>> => (
api.post(API.NODE.SAVE, { node }, configWithToken(access))
.then(resultMiddleware)
.catch(errorMiddleware)
);