redirect fixes

This commit is contained in:
Dennis Eichhorn 2024-04-26 22:02:22 +00:00
parent cdd04e94ed
commit e3aa0edec8
2 changed files with 4 additions and 3 deletions

View File

@ -26,7 +26,10 @@ echo $this->data['nav']->render(); ?>
<div class="col-xs-12 col-md-8">
<section class="portlet">
<div class="portlet-body">
<form id="fEditor" method="<?= $isNewDoc ? 'PUT' : 'POST'; ?>" action="<?= UriFactory::build('{/api}editor?{?}&csrf={$CSRF}'); ?>">
<form id="fEditor"
method="<?= $isNewDoc ? 'PUT' : 'POST'; ?>"
action="<?= UriFactory::build('{/api}editor?{?}&csrf={$CSRF}'); ?>"
<?= $isNewDoc ? 'data-redirect="' . UriFactory::build('{/base}/editor/view') . '?id={/0/response/id}"' : ''; ?>>
<div class="ipt-wrap">
<div class="ipt-first"><input name="title" type="text" class="wf-100" value="<?= $doc->title; ?>"></div>
<div class="ipt-second"><input type="submit" value="<?= $this->getHtml('Save'); ?>" name="save-editor"></div>

View File

@ -209,8 +209,6 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
$this->module->apiEditorUpdate($request, $response);
var_dump(EditorDocMapper::get()->where('id', 1)->execute());
self::assertEquals('Changed Title', $response->getDataArray('')['response']->title);
self::assertEquals('Changed Title', EditorDocMapper::get()->where('id', 1)->execute()->title);
self::assertEquals(1, $response->getDataArray('')['response']->id);