mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Añadido autorute a true y corregidos errores del metodo request-
This commit is contained in:
@ -70,9 +70,9 @@ class Clienteplantillaprecios extends \App\Controllers\BaseResourceController
|
||||
// plantilla desde la lista
|
||||
public function update($requestedId = null)
|
||||
{
|
||||
$requestMethod = $this->request->getMethod();
|
||||
|
||||
|
||||
if ($requestMethod === 'post') :
|
||||
if ($this->request->getPost()) :
|
||||
|
||||
if ($requestedId == null) :
|
||||
return;
|
||||
@ -94,12 +94,10 @@ class Clienteplantillaprecios extends \App\Controllers\BaseResourceController
|
||||
|
||||
public function add()
|
||||
{
|
||||
// JJO
|
||||
$session = session();
|
||||
|
||||
$requestMethod = $this->request->getMethod();
|
||||
|
||||
|
||||
if ($requestMethod === 'post') :
|
||||
if ($this->request->getPost()) :
|
||||
|
||||
$nullIfEmpty = true; // !(phpversion() >= '8.1');
|
||||
|
||||
@ -110,7 +108,7 @@ class Clienteplantillaprecios extends \App\Controllers\BaseResourceController
|
||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||
|
||||
// JJO
|
||||
$sanitizedData['user_created_id'] = $session->id_user;
|
||||
$sanitizedData['user_created_id'] = auth()->user()->id;
|
||||
|
||||
$noException = true;
|
||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
@ -172,8 +170,6 @@ class Clienteplantillaprecios extends \App\Controllers\BaseResourceController
|
||||
public function edit($requestedId = null)
|
||||
{
|
||||
|
||||
// JJO
|
||||
$session = session();
|
||||
|
||||
if ($requestedId == null) :
|
||||
return $this->redirect2listView();
|
||||
@ -186,9 +182,9 @@ class Clienteplantillaprecios extends \App\Controllers\BaseResourceController
|
||||
return $this->redirect2listView('sweet-error', $message);
|
||||
endif;
|
||||
|
||||
$requestMethod = $this->request->getMethod();
|
||||
|
||||
|
||||
if ($requestMethod === 'post') :
|
||||
if ($this->request->getPost()) :
|
||||
|
||||
$nullIfEmpty = true; // !(phpversion() >= '8.1');
|
||||
|
||||
@ -197,7 +193,7 @@ class Clienteplantillaprecios extends \App\Controllers\BaseResourceController
|
||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||
|
||||
// JJO
|
||||
$sanitizedData['user_updated_id'] = $session->id_user;
|
||||
$sanitizedData['user_updated_id'] = auth()->user()->id;
|
||||
|
||||
$noException = true;
|
||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
|
||||
Reference in New Issue
Block a user