Skip to content

Commit 3862f6c

Browse files
committed
fix(fetch): Enable pk finder in DELETE requests
1 parent abf70e5 commit 3862f6c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Entity/EntityFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,14 @@ public function fetchCollection(
174174
if(is_string($pks)){
175175
$pks = json_decode($pks, true);
176176
}
177-
if(!$pks && in_array($request->getMethod(), ['POST', 'PATCH', 'PUT'])){
177+
if(!$pks && in_array($request->getMethod(), ['POST', 'PATCH', 'PUT', 'DELETE'])){
178178
# POST/PATCH : Try to find PKs in body
179179
if (is_array($request->getParsedBody())) {
180180
$finder = new PksFinder([$pkName]);
181181
$pks = $finder->find($request->getParsedBody());
182182
}
183183
}
184-
184+
185185
$entityRequest->setPrimaryKey($pks);
186186

187187
# Next, we create the query (ModelCriteria), based on Action class (which can alter the query)

0 commit comments

Comments
 (0)