fix label type

This commit is contained in:
Rahul R 2024-01-22 12:47:05 +05:30
parent 7e95b8f160
commit 75965fc86e
3 changed files with 6 additions and 12 deletions

View File

@ -109,17 +109,11 @@ export type IssuePriorities = {
export interface IIssueLabel {
id: string;
created_at: Date;
updated_at: Date;
name: string;
description: string;
color: string;
created_by: string;
updated_by: string;
project: string;
project_detail: IProjectLite;
workspace: string;
workspace_detail: IWorkspaceLite;
project_id: string;
workspace_slug: string;
parent: string | null;
sort_order: number;
}

View File

@ -142,7 +142,7 @@ export class IssueRootStore implements IIssueRootStore {
if (rootStore.app.router.userId) this.userId = rootStore.app.router.userId;
if (!isEmpty(rootStore?.state?.stateMap)) this.states = Object.keys(rootStore?.state?.stateMap);
if (!isEmpty(rootStore?.state?.projectStates)) this.stateDetails = rootStore?.state?.projectStates;
if (!isEmpty(rootStore?.labelRoot?.labelMap)) this.labels = Object.keys(rootStore?.labelRoot?.labelMap);
if (!isEmpty(rootStore?.label?.labelMap)) this.labels = Object.keys(rootStore?.label?.labelMap);
if (!isEmpty(rootStore?.memberRoot?.workspace?.workspaceMemberMap))
this.members = Object.keys(rootStore?.memberRoot?.workspace?.workspaceMemberMap);
if (!isEmpty(rootStore?.projectRoot?.project?.projectMap))

View File

@ -82,7 +82,7 @@ export class LabelStore implements ILabelStore {
const currentWorkspaceDetails = this.rootStore.workspaceRoot.currentWorkspace;
const worksapceSlug = this.rootStore.app.router.workspaceSlug || "";
if (!currentWorkspaceDetails || !this.fetchedMap[worksapceSlug]) return;
return Object.values(this.labelMap).filter((label) => label.workspace === currentWorkspaceDetails.id);
return Object.values(this.labelMap).filter((label) => label.workspace_slug === currentWorkspaceDetails.slug);
}
/**
@ -92,7 +92,7 @@ export class LabelStore implements ILabelStore {
const projectId = this.rootStore.app.router.projectId;
const worksapceSlug = this.rootStore.app.router.workspaceSlug || "";
if (!projectId || !(this.fetchedMap[projectId] || this.fetchedMap[worksapceSlug])) return;
return Object.values(this.labelMap ?? {}).filter((label) => label.project === projectId);
return Object.values(this.labelMap ?? {}).filter((label) => label.project_id === projectId);
}
/**
@ -106,7 +106,7 @@ export class LabelStore implements ILabelStore {
getProjectLabels = computedFn((projectId: string | null) => {
const worksapceSlug = this.rootStore.app.router.workspaceSlug || "";
if (!projectId || !(this.fetchedMap[projectId] || this.fetchedMap[worksapceSlug])) return;
return Object.values(this.labelMap ?? {}).filter((label) => label.project === projectId);
return Object.values(this.labelMap ?? {}).filter((label) => label.project_id === projectId);
});
/**