mirror of
https://github.com/makeplane/plane.git
synced 2026-07-13 14:01:45 +02:00
fix: entity search endpoint (#2032)
This commit is contained in:
committed by
GitHub
parent
34115a932b
commit
87a4f9784d
@@ -13,12 +13,14 @@ import { RichTextEditor, RichTextReadOnlyEditor } from "@/components/editor";
|
||||
import { getDescriptionPlaceholder } from "@/helpers/issue.helper";
|
||||
// hooks
|
||||
import { useWorkspace } from "@/hooks/store";
|
||||
// services
|
||||
// plane web services
|
||||
import { WorkspaceService } from "@/plane-web/services/workspace.service";
|
||||
// plane web types
|
||||
import { TProject } from "@/plane-web/types";
|
||||
// services
|
||||
import { FileService } from "@/services/file.service";
|
||||
import { ProjectService } from "@/services/project";
|
||||
const fileService = new FileService();
|
||||
const projectService = new ProjectService();
|
||||
const workspaceService = new WorkspaceService();
|
||||
|
||||
export type ProjectDescriptionInputProps = {
|
||||
containerClassName?: string;
|
||||
@@ -98,7 +100,10 @@ export const ProjectDescriptionInput: FC<ProjectDescriptionInputProps> = observe
|
||||
workspaceId={workspaceId}
|
||||
projectId={project.id}
|
||||
searchMentionCallback={async (payload) =>
|
||||
await projectService.searchEntity(workspaceSlug?.toString() ?? "", project.id, payload)
|
||||
await workspaceService.searchEntity(workspaceSlug?.toString() ?? "", {
|
||||
...payload,
|
||||
project_id: project.id,
|
||||
})
|
||||
}
|
||||
dragDropEnabled
|
||||
onChange={(_description: object, description_html: string) => {
|
||||
|
||||
@@ -7,18 +7,19 @@ import { IssueEmbedCard, IssueEmbedUpgradeCard } from "@/plane-web/components/pa
|
||||
// plane web hooks
|
||||
import { useFlag } from "@/plane-web/hooks/store/use-flag";
|
||||
// services
|
||||
import { ProjectService } from "@/services/project";
|
||||
const projectService = new ProjectService();
|
||||
import { WorkspaceService } from "@/plane-web/services/workspace.service";
|
||||
const workspaceService = new WorkspaceService();
|
||||
|
||||
export const useIssueEmbed = (workspaceSlug: string, projectId: string) => {
|
||||
// store hooks
|
||||
const isIssueEmbedEnabled = useFlag(workspaceSlug, "PAGE_ISSUE_EMBEDS");
|
||||
|
||||
const fetchIssues = async (searchQuery: string): Promise<TEmbedItem[]> => {
|
||||
const response = await projectService.searchEntity(workspaceSlug, projectId, {
|
||||
const response = await workspaceService.searchEntity(workspaceSlug, {
|
||||
query_type: ["issue"],
|
||||
query: searchQuery,
|
||||
count: 10,
|
||||
project_id: projectId,
|
||||
});
|
||||
const structuredIssues: TEmbedItem[] = (response.issue ?? []).map((issue) => ({
|
||||
id: issue.id,
|
||||
|
||||
Reference in New Issue
Block a user