From: Marcin Haba Date: Thu, 27 Apr 2023 11:04:05 +0000 (+0200) Subject: baculum: Change overview behaviour in objects endpoint if used together with groupby... X-Git-Tag: Release-13.0.3~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f997d592e2d0b22e503f45859048d0492561de88;p=thirdparty%2Fbacula.git baculum: Change overview behaviour in objects endpoint if used together with groupby parameter --- diff --git a/gui/baculum/protected/API/Modules/ObjectManager.php b/gui/baculum/protected/API/Modules/ObjectManager.php index 4b0724571..45e657813 100644 --- a/gui/baculum/protected/API/Modules/ObjectManager.php +++ b/gui/baculum/protected/API/Modules/ObjectManager.php @@ -123,7 +123,7 @@ LEFT JOIN Client USING (ClientId) ' // Overview mode. $result = [ 'objects' => $result, - 'overview' => $overview + 'overview' => (is_string($group_by) ? $overview : $this->getObjectCountByObjectType($criteria)) ]; } return $result; diff --git a/gui/baculum/protected/API/openapi_baculum.json b/gui/baculum/protected/API/openapi_baculum.json index beadb4dc7..afeb9b703 100644 --- a/gui/baculum/protected/API/openapi_baculum.json +++ b/gui/baculum/protected/API/openapi_baculum.json @@ -8068,7 +8068,7 @@ "name": "overview", "in": "query", "required": false, - "description": "If set, it puts objects in 'objects' property and adds the 'overview' property with the object count by object type (PostgreSQL, MySQL, vSphere ...etc.) NOTE: Offset and limit parameters do not apply to overview counts.", + "description": "If set, it puts objects in 'objects' property and adds the 'overview' property with the object count by object type (PostgreSQL, MySQL, vSphere ...etc.) NOTE: Offset and limit parameters do apply to overview counts if used together 'groupby' parameter. With 'groupby' the counters behaviour is chanining and they display only count of currently listed objects.", "schema": { "type": "boolean" }