Commit 2972d1fb authored by wilhelmhb's avatar wilhelmhb

débuggage des ajouts de note à une ruche

parent 0697d192
......@@ -347,7 +347,7 @@ class PsBoxRestController extends FOSRestController
curl_close($ch);
$resultat = json_decode(utf8_encode($resultat), true);
return $resultat;*/
return true;
return $box;
}
/**
......
......@@ -16,6 +16,7 @@ use FOS\RestBundle\Controller\Annotations\Patch;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Form\FormTypeInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
use ApiBundle\Form\PsCustomNoteCustomerType;
use ApiBundle\Entity\CommonInterface;
......@@ -110,7 +111,7 @@ class PsCustomNoteCustomerRestController extends FOSRestController
$params
);
return $new;
return new JsonResponse($new, Codes::HTTP_CREATED);
$routeOptions = array(
'id' => $new->getId(),
'_format' => $request->get('_format')
......
......@@ -16,6 +16,7 @@ use FOS\RestBundle\Controller\Annotations\Patch;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Form\FormTypeInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
use ApiBundle\Form\PsDefaultNoteCustomerType;
use ApiBundle\Entity\CommonInterface;
......@@ -110,7 +111,7 @@ class PsDefaultNoteCustomerRestController extends FOSRestController
$params
);
return $new;
return new JsonResponse($new, Codes::HTTP_CREATED);
$routeOptions = array(
'id' => $new->getId(),
'_format' => $request->get('_format')
......@@ -260,9 +261,9 @@ class PsDefaultNoteCustomerRestController extends FOSRestController
*
* @return array
*/
public function getHiveAction($idHive) {
public function getHiveAction($id) {
$this->forwardIfNotAuthenticated();
return $this->container->get('api.psdefaultnotecustomer.handler')->findByIdHive($idHive);
return $this->getDoctrine()->getManager()->getRepository('ApiBundle:PsDefaultNoteCustomer')->findByIdHive($id);
}
}
?>
......@@ -114,7 +114,7 @@ class PsCustomerHandler implements CommonHandlerInterface {
public function delete(PsCustomer $pshive) {
$this->om->remove($pshive);
$this->om->flush();
$this->om->flush();
$response = new JsonResponse(['success' => true], 301);
$response->headers->set('Content-Type', 'application/json');
return $response;
......
......@@ -98,7 +98,7 @@ class PsCustomNoteCustomer
*/
public function getIdHive()
{
return $this->idHSive;
return $this->idHive;
}
/**
......
......@@ -45,7 +45,7 @@ class PsDefaultNoteCustomer
/**
* @var integer
*
* @ORM\Column(name="idCustomer", type="integer")
* @ORM\Column(name="id_customer", type="integer")
*/
private $idCustomer;
......
......@@ -15,9 +15,9 @@ class PsCustomNoteCustomerType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('id_custom_note')
->add('id_hive')
->add('date_add')
->add('idCustomNote')
->add('idHive')
->add('dateAdd')
;
}
......
......@@ -15,10 +15,10 @@ class PsDefaultNoteCustomerType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('id_default_note')
->add('id_hive')
->add('id_customer')
->add('date_add')
->add('idDefaultNote')
->add('idHive')
->add('idCustomer')
->add('dateAdd')
;
}
......
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