Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mathieu
potage
Commits
3c9f0a3a
Commit
3c9f0a3a
authored
Sep 07, 2018
by
Mat
Browse files
[non testé] groupes de serialization
parent
956007af
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/APIBundle/Controller/LegumeAPIController.php
View file @
3c9f0a3a
...
...
@@ -246,7 +246,7 @@ class LegumeAPIController extends MasterAPIController
{
$em
->
persist
(
$offrelegumes
);
$em
->
flush
();
return
$this
->
api
(
$offrelegumes
);
return
$this
->
api
(
$offrelegumes
,
200
,
array
(
'readOffreLegumes'
)
);
}
return
$this
->
api
(
$form
,
Response
::
HTTP_BAD_REQUEST
);
}
...
...
src/APIBundle/Controller/OffreAPIController.php
View file @
3c9f0a3a
...
...
@@ -58,7 +58,7 @@ class OffreAPIController extends MasterAPIController
$em
=
$this
->
getDoctrine
()
->
getManager
();
$em
->
persist
(
$offre
);
$em
->
flush
();
// TODO bug -> Notice: Array to string conversion
return
$this
->
api
(
$offre
);
return
$this
->
api
(
$offre
,
200
,
array
(
'readOffres'
)
);
}
return
$this
->
api
(
$form
,
Response
::
HTTP_BAD_REQUEST
);
}
...
...
@@ -89,7 +89,7 @@ class OffreAPIController extends MasterAPIController
if
(
$offre
===
null
)
{
return
$this
->
api
(
'Not found'
,
Response
::
HTTP_NOT_FOUND
);
}
return
$this
->
api
(
$offre
);
return
$this
->
api
(
$offre
,
200
,
array
(
'readOffres'
)
);
}
...
...
@@ -114,7 +114,7 @@ class OffreAPIController extends MasterAPIController
if
(
$form
->
isSubmitted
()
&&
$form
->
isValid
())
{
$em
->
flush
();
return
$this
->
api
(
$offre
);
return
$this
->
api
(
$offre
,
200
,
array
(
'readOffres'
)
);
}
return
$this
->
api
(
$form
,
Response
::
HTTP_BAD_REQUEST
);
}
...
...
@@ -141,7 +141,7 @@ class OffreAPIController extends MasterAPIController
if
(
$form
->
isSubmitted
()
&&
$form
->
isValid
())
{
$em
->
flush
();
return
$this
->
api
(
$offre
);
return
$this
->
api
(
$offre
,
200
,
array
(
'readOffres'
)
);
}
return
$this
->
api
(
$form
,
Response
::
HTTP_BAD_REQUEST
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment