Skip to content

Commit

Permalink
Fixed bug where user endpoint used wrong include code
Browse files Browse the repository at this point in the history
  • Loading branch information
jessevz committed Jan 23, 2025
1 parent 32317f5 commit 8d090a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/inc/apiv2/common/AbstractModelAPI.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ protected function getPrimaryKeyOther(string $dbaClass): string
* @return array $many2One which is a map where the key is the id of the parent object and the value is an array of the included
* objects that are included for this parent object
*/
//A bit hacky solution to get a to one through an intermediate table, needed when from a task you need to include the hashlists
//A bit hacky solution to get a to one through an intermediate table, currently only used by tasks to include a hashlist through the taskwrapper
//another solution can be to overwrite fetchExpandObjects() in tasks.routes
final protected static function getManyToOneRelationViaIntermediate(
array $objects,
string $objectField,
Expand Down
2 changes: 1 addition & 1 deletion src/inc/apiv2/model/users.routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected static function fetchExpandObjects(array $objects, string $expand): mi
/* Expand requested section */
switch($expand) {
case 'accessGroups':
return self::getManyToOneRelationViaIntermediate(
return self::getManyToManyRelationViaIntermediate(
$objects,
User::USER_ID,
Factory::getAccessGroupUserFactory(),
Expand Down

0 comments on commit 8d090a4

Please sign in to comment.