Commit 57ad9b5d authored by Mat's avatar Mat

3 erreurs résolues pour faire fonctionner la soumission puis le refresh du formulaire create ->

* l'action s'appuie sur OwnerAPIType
* compléter la PrePersist pour modify_at
* erreur de frappe sur la méthode ajax
parent ce3d065a
......@@ -5,7 +5,7 @@ namespace TechnoBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use TechnoBundle\Entity\Owner;
use TechnoBundle\Form\Owner\OwnerType;
use APIBundle\Form\Owner\OwnerAPIType;
class OwnerController extends MasterController
......@@ -105,7 +105,7 @@ class OwnerController extends MasterController
*/
public function mainDisplayAction()
{
$form = $this->createForm(OwnerType::class);
$form = $this->createForm(OwnerAPIType::class);
return $this->render('@Techno/Ajax/Owner/mainDisplay.html.twig', array(
'formOwner' => $form->createView()
......
......@@ -157,6 +157,7 @@ class Owner
public function PrePersist()
{
$this->createdAt = new \DateTime();
$this->modifyAt = new \DateTime();
}
/**
......
......@@ -142,7 +142,7 @@
e.preventDefault();
let xhr = new XMLHttpRequest();
xhr.onreadystatehange = function() {
xhr.onreadystatechange = function() {
if (this.readyState === 4 && this.status === 200) {
reloadTableOwner();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment