From a3a2fb84a3845dddc20934a0f8c12dc46c2e07dc Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia Date: Fri, 22 Sep 2023 15:17:15 +0530 Subject: [PATCH] chore: workspace view services and types --- web/services/workspace.service.ts | 7 +++++-- web/types/workspace.d.ts | 26 ++++++++++++++++---------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/web/services/workspace.service.ts b/web/services/workspace.service.ts index 627afd755..385e61fd6 100644 --- a/web/services/workspace.service.ts +++ b/web/services/workspace.service.ts @@ -15,6 +15,7 @@ import { IWorkspaceBulkInviteFormData, IWorkspaceViewProps, IView, + WorkspaceViewIssueParams, } from "types"; class WorkspaceService extends APIService { @@ -303,8 +304,10 @@ class WorkspaceService extends APIService { }); } - async getViewIssues(workspaceSlug: string, params: any): Promise { - return this.get(`/api/workspaces/${workspaceSlug}/issues/`, { params }) + async getViewIssues(workspaceSlug: string, params: WorkspaceViewIssueParams): Promise { + return this.get(`/api/workspaces/${workspaceSlug}/issues/`, { + params, + }) .then((response) => response?.data) .catch((error) => { throw error?.response?.data; diff --git a/web/types/workspace.d.ts b/web/types/workspace.d.ts index de0bc93e2..4bc50f757 100644 --- a/web/types/workspace.d.ts +++ b/web/types/workspace.d.ts @@ -1,13 +1,4 @@ -import type { - IIssueFilterOptions, - IProjectMember, - IUser, - IUserMemberLite, - IWorkspaceViewProps, - TIssueGroupByOptions, - TIssueOrderByOptions, - TIssueViewOptions, -} from "types"; +import type { IProjectMember, IUser, IUserMemberLite, IWorkspaceViewProps } from "types"; export interface IWorkspace { readonly id: string; @@ -123,6 +114,21 @@ export interface IWorkspaceSearchResults { }; } +export interface WorkspaceViewIssueParams { + assignees: string | undefined; + created_by: string | undefined; + estimate_point: string | undefined; + labels: string | undefined; + priority: string | undefined; + state: string | undefined; + state_group: string | undefined; + start_date: string | undefined; + target_date: string | undefined; + type: "active" | "backlog" | undefined; + project: string | undefined; + sub_issue: boolean; +} + export interface IProductUpdateResponse { url: string; assets_url: string;