Move response feedback to backend

This commit is contained in:
Dennis Eichhorn 2018-02-15 18:17:36 +01:00
parent 14bb7e8d1c
commit 8626411e4b
4 changed files with 15 additions and 5 deletions

View File

@ -514,7 +514,12 @@ class Controller extends ModuleAbstract implements WebInterface
GroupMapper::update($group);
$response->set($request->__toString(), $group->jsonSerialize());
$response->set($request->__toString(), [
'status' => 'ok',
'title' => 'Group',
'message' => 'Group successfully updated.',
'request' => $group->jsonSerialize()
]);
}
/**
@ -572,7 +577,12 @@ class Controller extends ModuleAbstract implements WebInterface
$group = $this->createGroupFromRequest($request);
GroupMapper::create($group);
$response->set($request->__toString(), $group->jsonSerialize());
$response->set($request->__toString(), [
'status' => 'ok',
'title' => 'Group',
'message' => 'Group successfully created.',
'request' => $group->jsonSerialize()
]);
}
/**

View File

@ -21,7 +21,7 @@ echo $this->getData('nav')->render(); ?>
<section class="box wf-100">
<header><h1><?= $this->getHtml('Account'); ?></h1></header>
<div class="inner">
<form id="fAccount" action="<?= \phpOMS\Uri\UriFactory::build('/{/lang}/api/admin/account'); ?>" method="put" data-msg='{"title": "Some Title", "message": "My Message"}'>
<form id="fAccount" action="<?= \phpOMS\Uri\UriFactory::build('/{/lang}/api/admin/account'); ?>" method="put">
<table class="layout wf-100">
<tbody>
<tr><td><label for="iType"><?= $this->getHtml('Type'); ?></label>

View File

@ -21,7 +21,7 @@ echo $this->getData('nav')->render(); ?>
<section class="box wf-100">
<header><h1><?= $this->getHtml('Group'); ?></h1></header>
<div class="inner">
<form id="group-create" action="<?= \phpOMS\Uri\UriFactory::build('/{/lang}/api/admin/group'); ?>" method="put" data-msg='{"title": "Some Title", "message": "My Message"}'>
<form id="group-create" action="<?= \phpOMS\Uri\UriFactory::build('/{/lang}/api/admin/group'); ?>" method="put">
<table class="layout wf-100">
<tbody>
<tr><td><label for="iStatus"><?= $this->getHtml('Status'); ?></label>

View File

@ -25,7 +25,7 @@ echo $this->getData('nav')->render(); ?>
<section class="box wf-100">
<header><h1><?= $this->getHtml('Group'); ?></h1></header>
<div class="inner">
<form id="fGroupEdit" action="<?= \phpOMS\Uri\UriFactory::build('/{/lang}/api/admin/group'); ?>" method="post" data-msg='{"title": "Some Title", "message": "My Message"}'>
<form id="fGroupEdit" action="<?= \phpOMS\Uri\UriFactory::build('/{/lang}/api/admin/group'); ?>" method="post">
<table class="layout wf-100">
<tbody>
<tr><td><label for="iGid"><?= $this->getHtml('ID', 0, 0); ?></label>