mirror of
https://github.com/docmost/docmost.git
synced 2026-06-16 06:57:01 +08:00
fix attachment search in cloud
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
|||||||
IPageSearchParams,
|
IPageSearchParams,
|
||||||
} from "@/features/search/types/search.types";
|
} from "@/features/search/types/search.types";
|
||||||
import { useLicense } from "@/ee/hooks/use-license";
|
import { useLicense } from "@/ee/hooks/use-license";
|
||||||
|
import { isCloud } from "@/lib/config";
|
||||||
|
|
||||||
export type UnifiedSearchResult = IPageSearch | IAttachmentSearch;
|
export type UnifiedSearchResult = IPageSearch | IAttachmentSearch;
|
||||||
|
|
||||||
@@ -22,7 +23,7 @@ export function useUnifiedSearch(
|
|||||||
const { hasLicenseKey } = useLicense();
|
const { hasLicenseKey } = useLicense();
|
||||||
|
|
||||||
const isAttachmentSearch =
|
const isAttachmentSearch =
|
||||||
params.contentType === "attachment" && hasLicenseKey;
|
params.contentType === "attachment" && (isCloud() || hasLicenseKey);
|
||||||
const searchType = isAttachmentSearch ? "attachment" : "page";
|
const searchType = isAttachmentSearch ? "attachment" : "page";
|
||||||
|
|
||||||
return useQuery({
|
return useQuery({
|
||||||
|
|||||||
Reference in New Issue
Block a user