mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
optional comment view authentifiction
This commit is contained in:
parent
fada25ee10
commit
d1e369f723
2 changed files with 4 additions and 2 deletions
|
@ -51,11 +51,13 @@ export const postNodeComment = ({
|
||||||
|
|
||||||
export const getNodeComments = ({
|
export const getNodeComments = ({
|
||||||
id,
|
id,
|
||||||
|
access,
|
||||||
}: {
|
}: {
|
||||||
id: number;
|
id: number;
|
||||||
|
access: string;
|
||||||
}): Promise<IResultWithStatus<{ comment: Comment }>> =>
|
}): Promise<IResultWithStatus<{ comment: Comment }>> =>
|
||||||
api
|
api
|
||||||
.get(API.NODE.COMMENT(id))
|
.get(API.NODE.COMMENT(id), configWithToken(access))
|
||||||
.then(resultMiddleware)
|
.then(resultMiddleware)
|
||||||
.catch(errorMiddleware);
|
.catch(errorMiddleware);
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ function* onNodeLoad({ id, node_type }: ReturnType<typeof nodeLoadNode>) {
|
||||||
// todo: load comments
|
// todo: load comments
|
||||||
const {
|
const {
|
||||||
data: { comments },
|
data: { comments },
|
||||||
} = yield call(getNodeComments, { id });
|
} = yield call(reqWrapper, getNodeComments, { id });
|
||||||
|
|
||||||
yield put(nodeSetComments(comments || []));
|
yield put(nodeSetComments(comments || []));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue