Skip to content

Commit

Permalink
fixes delete by auto id
Browse files Browse the repository at this point in the history
  • Loading branch information
Elorfin authored Aug 26, 2024
1 parent b755c52 commit 86d00dc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/app/Controller/RequestDecoderTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ protected function decodeIdsString(Request $request, string $class, string $prop
return [];
}

return $this->om->getRepository($class)->findBy(['uuid' => $ids]);
$idProp = 'uuid';
if (is_numeric($ids[0])) {
$idProp = 'id';
}

return $this->om->getRepository($class)->findBy([$idProp => $ids]);
}
}

0 comments on commit 86d00dc

Please sign in to comment.