Skip to content

Commit

Permalink
Fixed route creation based on Content Type status
Browse files Browse the repository at this point in the history
  • Loading branch information
mnocon committed Mar 31, 2022
1 parent 446828f commit 72e2578
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function visit(Visitor $visitor, Generator $generator, $data)
$visitor->setHeader(
'Location',
$this->router->generate(
"ibexa.rest.load_content_type_{$draftUriPart}field_definition",
"ibexa.rest.load_content_type{$draftUriPart}_field_definition",
[
'contentTypeId' => $restFieldDefinition->contentType->id,
'fieldDefinitionId' => $restFieldDefinition->fieldDefinition->id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function visit(Visitor $visitor, Generator $generator, $data)
$generator->startAttribute(
'href',
$this->router->generate(
'ibexa.rest.load_content_type_' . $urlTypeSuffix . 'field_definition_list',
'ibexa.rest.load_content_type' . $urlTypeSuffix . '_field_definition_list',
[
'contentTypeId' => $contentType->id,
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ protected function getUrlTypeSuffix($contentTypeStatus)
{
switch ($contentTypeStatus) {
case Values\ContentType\ContentType::STATUS_DRAFT:
return 'draft_';
return '_draft';
case Values\ContentType\ContentType::STATUS_MODIFIED:
return 'modified_';
return '_modified';
case Values\ContentType\ContentType::STATUS_DEFINED:
default:
return '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function visit(Visitor $visitor, Generator $generator, $data)
$generator->startAttribute(
'href',
$this->router->generate(
"ibexa.rest.load_content_type_{$urlTypeSuffix}field_definition",
"ibexa.rest.load_content_type{$urlTypeSuffix}_field_definition",
[
'contentTypeId' => $contentType->id,
'fieldDefinitionId' => $fieldDefinition->id,
Expand Down

0 comments on commit 72e2578

Please sign in to comment.