chore: workspace view services and types

This commit is contained in:
Anmol Singh Bhatia 2023-09-22 15:17:15 +05:30
parent 6af2aa666a
commit a3a2fb84a3
2 changed files with 21 additions and 12 deletions

View File

@ -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<any> {
return this.get(`/api/workspaces/${workspaceSlug}/issues/`, { params })
async getViewIssues(workspaceSlug: string, params: WorkspaceViewIssueParams): Promise<any> {
return this.get(`/api/workspaces/${workspaceSlug}/issues/`, {
params,
})
.then((response) => response?.data)
.catch((error) => {
throw error?.response?.data;

View File

@ -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;