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 }) => {
|
||||
const { data, error, mutate } = useSWR<Array<IDocument>>(
|
||||
isShare ? '/document/public/children' : `/document/children`,
|
||||
wikiId || documentId ? (url) => HttpClient.post(url, { wikiId, documentId, isShare }) : null,
|
||||
wikiId + '/' + documentId,
|
||||
wikiId || documentId
|
||||
? () =>
|
||||
HttpClient.post(isShare ? '/document/public/children' : `/document/children`, { wikiId, documentId, isShare })
|
||||
: null,
|
||||
{ shouldRetryOnError: false }
|
||||
);
|
||||
const loading = !data && !error;
|
||||
|
|
|
@ -495,6 +495,7 @@ export class DocumentService {
|
|||
if (document.isWikiHome) {
|
||||
unSortDocuments = await this.documentRepo.find({
|
||||
wikiId: document.wikiId,
|
||||
parentDocumentId: null,
|
||||
isWikiHome: false,
|
||||
});
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue