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
a662256221
commit
148974ab7d
8 changed files with 56 additions and 9 deletions
|
@ -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)
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue