chore: workspace entity search endpoint (#6272)

* chore: workspace entity search endpoint

* fix: editor entity search endpoint

* chore: restrict guest users

---------

Co-authored-by: Aaryan Khandelwal <aaryankhandu123@gmail.com>
This commit is contained in:
Bavisetti Narayan 2024-12-26 15:00:32 +05:30 committed by GitHub
parent 2d9464e841
commit f54f3a6091
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 481 additions and 233 deletions

View file

@ -12,6 +12,8 @@ import {
IUserProjectsRole,
IWorkspaceView,
TIssuesResponse,
TSearchResponse,
TSearchEntityRequestPayload,
} from "@plane/types";
import { APIService } from "@/services/api.service";
// helpers
@ -277,4 +279,17 @@ export class WorkspaceService extends APIService {
throw error?.response?.data;
});
}
async searchEntity(workspaceSlug: string, params: TSearchEntityRequestPayload): Promise<TSearchResponse> {
return this.get(`/api/workspaces/${workspaceSlug}/entity-search/`, {
params: {
...params,
query_type: params.query_type.join(","),
},
})
.then((response) => response?.data)
.catch((error) => {
throw error?.response?.data;
});
}
}