mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
flow get more
This commit is contained in:
parent
f440a5f4c3
commit
971578bb21
11 changed files with 281 additions and 159 deletions
|
@ -1,11 +1,16 @@
|
|||
import { api, configWithToken, resultMiddleware, errorMiddleware } from '~/utils/api';
|
||||
import { INode, IResultWithStatus } from '../types';
|
||||
import { API } from '~/constants/api';
|
||||
import { flowSetCellView } from '~/redux/flow/actions';
|
||||
import {
|
||||
api,
|
||||
configWithToken,
|
||||
resultMiddleware,
|
||||
errorMiddleware
|
||||
} from "~/utils/api";
|
||||
import { INode, IResultWithStatus } from "../types";
|
||||
import { API } from "~/constants/api";
|
||||
import { flowSetCellView } from "~/redux/flow/actions";
|
||||
|
||||
export const postNode = ({
|
||||
access,
|
||||
node,
|
||||
node
|
||||
}: {
|
||||
access: string;
|
||||
node: INode;
|
||||
|
@ -15,24 +20,24 @@ export const postNode = ({
|
|||
.then(resultMiddleware)
|
||||
.catch(errorMiddleware);
|
||||
|
||||
export const getNodes = ({
|
||||
skip = 0,
|
||||
}: {
|
||||
skip: number;
|
||||
}): Promise<IResultWithStatus<{ nodes: INode[] }>> =>
|
||||
api
|
||||
.get(API.NODE.GET, { params: { skip } })
|
||||
.then(resultMiddleware)
|
||||
.catch(errorMiddleware);
|
||||
// export const getNodes = ({
|
||||
// from = null
|
||||
// }: {
|
||||
// from: string;
|
||||
// }): Promise<IResultWithStatus<{ nodes: INode[] }>> =>
|
||||
// api
|
||||
// .get(API.NODE.GET, { params: { from } })
|
||||
// .then(resultMiddleware)
|
||||
// .catch(errorMiddleware);
|
||||
|
||||
export const postCellView = ({
|
||||
id,
|
||||
flow,
|
||||
access,
|
||||
access
|
||||
}: ReturnType<typeof flowSetCellView> & { access: string }): Promise<
|
||||
IResultWithStatus<{ is_liked: INode['is_liked'] }>
|
||||
IResultWithStatus<{ is_liked: INode["is_liked"] }>
|
||||
> =>
|
||||
api
|
||||
.post(API.NODE.SET_CELL_VIEW(id), { flow }, configWithToken(access))
|
||||
.then(resultMiddleware)
|
||||
.catch(errorMiddleware);
|
||||
.catch(errorMiddleware);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue