`TOGGLE_STAR_DOUCMENT ` => `TOGGLE_STAR_DOCUMENT `
This commit is contained in:
YangFong 2024-03-05 14:14:57 +08:00
parent 4597430f34
commit 8b18a56e71
2 changed files with 7 additions and 7 deletions

View File

@ -3,7 +3,7 @@ import { useQuery, UseQueryOptions } from 'react-query';
import { IDocument, IWiki, StarApiDefinition } from '@think/domains'; import { IDocument, IWiki, StarApiDefinition } from '@think/domains';
import { event, TOGGLE_STAR_DOUCMENT, TOGGLE_STAR_WIKI, triggerToggleStarDocument, triggerToggleStarWiki } from 'event'; import { event, TOGGLE_STAR_DOCUMENT, TOGGLE_STAR_WIKI, triggerToggleStarDocument, triggerToggleStarWiki } from 'event';
import { HttpClient } from 'services/http-client'; import { HttpClient } from 'services/http-client';
export type IWikiWithIsMember = IWiki & { isMember?: boolean }; export type IWikiWithIsMember = IWiki & { isMember?: boolean };
@ -122,10 +122,10 @@ export const useStarDocumentsInOrganization = (organizationId) => {
} }
); );
useEffect(() => { useEffect(() => {
event.on(TOGGLE_STAR_DOUCMENT, refetch); event.on(TOGGLE_STAR_DOCUMENT, refetch);
return () => { return () => {
event.off(TOGGLE_STAR_DOUCMENT, refetch); event.off(TOGGLE_STAR_DOCUMENT, refetch);
}; };
}, [refetch]); }, [refetch]);
return { data, error, loading: isLoading, refresh: refetch }; return { data, error, loading: isLoading, refresh: refetch };
@ -218,10 +218,10 @@ export const useStarDocumentsInWiki = (organizationId, wikiId) => {
); );
useEffect(() => { useEffect(() => {
event.on(TOGGLE_STAR_DOUCMENT, refetch); event.on(TOGGLE_STAR_DOCUMENT, refetch);
return () => { return () => {
event.off(TOGGLE_STAR_DOUCMENT, refetch); event.off(TOGGLE_STAR_DOCUMENT, refetch);
}; };
}, [refetch]); }, [refetch]);

View File

@ -8,7 +8,7 @@ export const REFRESH_ORGANIZATIONS = 'REFRESH_ORGANIZATIONS'; // 刷新组织列
export const REFRESH_TOCS = `REFRESH_TOCS`; // 刷新知识库目录 export const REFRESH_TOCS = `REFRESH_TOCS`; // 刷新知识库目录
export const CREATE_DOCUMENT = `CREATE_DOCUMENT`; export const CREATE_DOCUMENT = `CREATE_DOCUMENT`;
export const TOGGLE_STAR_WIKI = `TOGGLE_STAR_WIKI`; // 收藏或取消收藏知识库 export const TOGGLE_STAR_WIKI = `TOGGLE_STAR_WIKI`; // 收藏或取消收藏知识库
export const TOGGLE_STAR_DOUCMENT = `TOGGLE_STAR_DOUCMENT`; // 收藏或取消收藏文档 export const TOGGLE_STAR_DOCUMENT = `TOGGLE_STAR_DOCUMENT`; // 收藏或取消收藏文档
/** /**
* *
@ -60,7 +60,7 @@ export const triggerToggleStarWiki = () => {
}; };
export const triggerToggleStarDocument = () => { export const triggerToggleStarDocument = () => {
event.emit(TOGGLE_STAR_DOUCMENT); event.emit(TOGGLE_STAR_DOCUMENT);
}; };
export const triggerRefreshOrganizations = () => { export const triggerRefreshOrganizations = () => {