Skip to content

Commit 12d14a5

Browse files
committed
Fix this issue
1 parent 7265f1c commit 12d14a5

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/lib/items/RouteData.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,12 @@ protected function detectUrlPattern():void
317317
$parts = explode('/', $customRoute);
318318
$this->action = array_pop($parts);
319319
$this->controller = array_pop($parts);
320+
321+
if ($this->action === 'list') {
322+
$this->type = self::TYPE_COLLECTION;
323+
} elseif ($this->action === 'view') {
324+
$this->type = self::TYPE_RESOURCE;
325+
}
320326
}
321327
return;
322328
}

tests/specs/issue_fix/102_fractalaction_not_generated_for_root_path/index.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
'excludeModels' => [
88
'Error',
99
],
10+
'useJsonApi' => true,
1011
'generateControllers' => true,
1112
'generateMigrations' => false,
1213
'generateModelFaker' => false,

0 commit comments

Comments
 (0)