OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Fix iterating filters when none exist
Oliver Günther078fce9f32da
diff --git a/frontend/src/app/core/apiv3/paths/apiv3-resource.ts b/frontend/src/app/core/apiv3/paths/apiv3-resource.tsindex f4f1796cdd5..24f91429cba 100644--- a/frontend/src/app/core/apiv3/paths/apiv3-resource.ts+++ b/frontend/src/app/core/apiv3/paths/apiv3-resource.ts@@ -106,12 +106,19 @@ export class ApiV3ResourceCollection<V, T extends ApiV3GettableResource<V>> exteif (url.searchParams.has('filters')) {const existingFilters = JSON.parse(url.searchParams.get('filters') as string) as ApiV3Filter[];url.searchParams.set('filters', JSON.stringify(existingFilters.concat(filters.filters)));- const cls = resourceClass || APIv3GettableResource;-- // eslint-disable-next-line new-cap- return new cls(this.apiRoot, url.pathname + url.search, '', this) as R;+ } else {+ url.searchParams.set('filters', filters.toJson());}- return this.subResource<R>(`?${filters.toParams(params)}`, resourceClass);++ Object+ .keys(params)+ .forEach((key) => {+ url.searchParams.set(key, params[key]);+ });++ const cls = resourceClass || APIv3GettableResource;+ // eslint-disable-next-line new-cap+ return new cls(this.apiRoot, url.pathname, url.search, this) as R;}/**@@ -120,6 +127,7 @@ export class ApiV3ResourceCollection<V, T extends ApiV3GettableResource<V>> exte* @param segment Additional segment to add to the current path*/protected subResource<R = ApiV3GettableResource<HalResource>>(segment:string, cls:Constructor<R> = ApiV3GettableResource as any):R {+ // eslint-disable-next-line new-capreturn new cls(this.apiRoot, this.path, segment, this);}}