1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

moved flow files

This commit is contained in:
Fedor Katurov 2022-01-04 19:37:46 +07:00
parent a068f56abf
commit b1e8bddbaf
4 changed files with 5 additions and 5 deletions

24
src/api/flow/index.ts Normal file
View file

@ -0,0 +1,24 @@
import { api, cleanResult, configWithToken } from '~/utils/api';
import { INode, IResultWithStatus } from 'src/redux/types';
import { API } from '~/constants/api';
import { PostCellViewRequest, PostCellViewResult } from '~/types/node';
import { GetSearchResultsRequest, GetSearchResultsResult } from '~/types/flow';
export const postNode = ({
access,
node,
}: {
access: string;
node: INode;
}): Promise<IResultWithStatus<INode>> =>
api.post(API.NODE.SAVE, { node }, configWithToken(access)).then(cleanResult);
export const postCellView = ({ id, flow }: PostCellViewRequest) =>
api
.post<PostCellViewResult>(API.NODE.SET_CELL_VIEW(id), { flow })
.then(cleanResult);
export const getSearchResults = ({ text, skip, take }: GetSearchResultsRequest) =>
api
.get<GetSearchResultsResult>(API.SEARCH.NODES, { params: { text, skip, take } })
.then(cleanResult);