forked from github/plane
[WEB-914]: fix: Exception due to cycles and modules for undefined fields (#4127)
* fix cycle types * fix module types
This commit is contained in:
@@ -256,7 +256,7 @@ export class CycleStore implements ICycleStore {
|
||||
(c) =>
|
||||
c.project_id === projectId &&
|
||||
!c.archived_at &&
|
||||
c.status.toLowerCase() === "completed" &&
|
||||
c.status?.toLowerCase() === "completed" &&
|
||||
c.name.toLowerCase().includes(searchQuery.toLowerCase()) &&
|
||||
shouldFilterCycle(c, filters ?? {})
|
||||
);
|
||||
|
||||
@@ -380,7 +380,7 @@ export class ModulesStore implements IModuleStore {
|
||||
) => {
|
||||
const originalModuleDetails = this.getModuleById(moduleId);
|
||||
try {
|
||||
const linkModules = originalModuleDetails?.link_module.map((link) =>
|
||||
const linkModules = originalModuleDetails?.link_module?.map((link) =>
|
||||
link.id === linkId ? { ...link, ...data } : link
|
||||
);
|
||||
runInAction(() => {
|
||||
@@ -407,7 +407,7 @@ export class ModulesStore implements IModuleStore {
|
||||
deleteModuleLink = async (workspaceSlug: string, projectId: string, moduleId: string, linkId: string) =>
|
||||
await this.moduleService.deleteModuleLink(workspaceSlug, projectId, moduleId, linkId).then(() => {
|
||||
const moduleDetails = this.getModuleById(moduleId);
|
||||
const linkModules = moduleDetails?.link_module.filter((link) => link.id !== linkId);
|
||||
const linkModules = moduleDetails?.link_module?.filter((link) => link.id !== linkId);
|
||||
runInAction(() => {
|
||||
set(this.moduleMap, [moduleId, "link_module"], linkModules);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user