mirror of https://github.com/fantasticit/think.git
fix: fix get document children
This commit is contained in:
parent
34f6456e4c
commit
f7fcc71a99
|
@ -221,8 +221,11 @@ export const useCollaborationDocument = (documentId) => {
|
||||||
*/
|
*/
|
||||||
export const useChildrenDocument = ({ wikiId, documentId, isShare = false }) => {
|
export const useChildrenDocument = ({ wikiId, documentId, isShare = false }) => {
|
||||||
const { data, error, mutate } = useSWR<Array<IDocument>>(
|
const { data, error, mutate } = useSWR<Array<IDocument>>(
|
||||||
isShare ? '/document/public/children' : `/document/children`,
|
wikiId + '/' + documentId,
|
||||||
wikiId || documentId ? (url) => HttpClient.post(url, { wikiId, documentId, isShare }) : null,
|
wikiId || documentId
|
||||||
|
? () =>
|
||||||
|
HttpClient.post(isShare ? '/document/public/children' : `/document/children`, { wikiId, documentId, isShare })
|
||||||
|
: null,
|
||||||
{ shouldRetryOnError: false }
|
{ shouldRetryOnError: false }
|
||||||
);
|
);
|
||||||
const loading = !data && !error;
|
const loading = !data && !error;
|
||||||
|
|
|
@ -495,6 +495,7 @@ export class DocumentService {
|
||||||
if (document.isWikiHome) {
|
if (document.isWikiHome) {
|
||||||
unSortDocuments = await this.documentRepo.find({
|
unSortDocuments = await this.documentRepo.find({
|
||||||
wikiId: document.wikiId,
|
wikiId: document.wikiId,
|
||||||
|
parentDocumentId: null,
|
||||||
isWikiHome: false,
|
isWikiHome: false,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue