Skip to content

Commit

Permalink
cleanup tasklist service api [ci:force]
Browse files Browse the repository at this point in the history
  • Loading branch information
DenysVuika committed May 13, 2024
1 parent 263edcc commit 1d4caef
Showing 1 changed file with 4 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ export class TaskListService {
*/
getFilterForTaskById(taskId: string, filterList: FilterRepresentationModel[]): Observable<FilterRepresentationModel> {
return from(filterList).pipe(
flatMap((data: FilterRepresentationModel) => this.isTaskRelatedToFilter(taskId, data)),
filter((data: FilterRepresentationModel) => data != null)
flatMap((data) => this.isTaskRelatedToFilter(taskId, data)),
filter((data) => data != null)
);
}

Expand Down Expand Up @@ -155,15 +155,7 @@ export class TaskListService {
* @returns Array of checklist task details
*/
getTaskChecklist(id: string): Observable<TaskDetailsModel[]> {
return from(this.checklistsApi.getChecklist(id)).pipe(
map((response) => {
const checklists: TaskDetailsModel[] = [];
response.data.forEach((checklist) => {
checklists.push(new TaskDetailsModel(checklist));
});
return checklists;
})
);
return from(this.checklistsApi.getChecklist(id)).pipe(map((response) => response.data.map((checklist) => new TaskDetailsModel(checklist))));
}

/**
Expand All @@ -178,15 +170,7 @@ export class TaskListService {
modelType: 2 // Integer | modelType
};

return from(this.modelsApi.getModels(opts)).pipe(
map((response) => {
const forms: Form[] = [];
response.data.forEach((form) => {
forms.push(new Form(form.id, form.name));
});
return forms;
})
);
return from(this.modelsApi.getModels(opts)).pipe(map((response) => response.data.map((form) => new Form(form.id, form.name))));
}

/**
Expand Down

0 comments on commit 1d4caef

Please sign in to comment.