Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mathieu
potage
Commits
b0c49d46
Commit
b0c49d46
authored
Aug 28, 2018
by
Mat
Browse files
api, ajoute un groupe de sérialisation pour limiter la profondeur du json
parent
e340555b
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/APIBundle/Controller/InfoAPIController.php
View file @
b0c49d46
...
...
@@ -141,7 +141,7 @@ class InfoAPIController extends MasterAPIController
}
$em
->
flush
();
return
$this
->
api
(
$info
);
return
$this
->
api
(
$info
,
200
,
array
(
'readInfos'
)
);
}
return
$this
->
api
(
$form
,
Response
::
HTTP_BAD_REQUEST
);
}
...
...
src/APIBundle/Controller/LettreAPIController.php
100755 → 100644
View file @
b0c49d46
...
...
@@ -58,7 +58,7 @@ class LettreAPIController extends MasterAPIController
$em
->
persist
(
$lettre
);
$em
->
flush
();
return
$this
->
api
(
$lettre
);
return
$this
->
api
(
$lettre
,
200
,
array
(
'readLettres'
)
);
}
return
$this
->
api
(
$form
,
Response
::
HTTP_BAD_REQUEST
);
}
...
...
@@ -88,7 +88,7 @@ class LettreAPIController extends MasterAPIController
if
(
$lettre
===
null
)
{
return
$this
->
api
(
'Not found'
,
Response
::
HTTP_NOT_FOUND
);
}
return
$this
->
api
(
$lettre
);
return
$this
->
api
(
$lettre
,
200
,
array
(
'readLettres'
)
);
}
...
...
@@ -113,7 +113,7 @@ class LettreAPIController extends MasterAPIController
if
(
$form
->
isSubmitted
()
&&
$form
->
isValid
())
{
$em
->
flush
();
return
$this
->
api
(
$lettre
);
return
$this
->
api
(
$lettre
,
200
,
array
(
'readLettres'
)
);
}
return
$this
->
api
(
$form
,
Response
::
HTTP_BAD_REQUEST
);
}
...
...
@@ -140,7 +140,7 @@ class LettreAPIController extends MasterAPIController
if
(
$form
->
isSubmitted
()
&&
$form
->
isValid
())
{
$em
->
flush
();
return
$this
->
api
(
$lettre
);
return
$this
->
api
(
$lettre
,
200
,
array
(
'readLettres'
)
);
}
return
$this
->
api
(
$form
,
Response
::
HTTP_BAD_REQUEST
);
}
...
...
@@ -211,7 +211,7 @@ class LettreAPIController extends MasterAPIController
if
(
$form
->
isSubmitted
()
&&
$form
->
isValid
())
{
$em
->
flush
();
return
$this
->
api
(
[]
);
return
$this
->
api
(
$lettre
,
200
,
array
(
'readLettres'
)
);
}
return
$this
->
api
(
$form
,
Response
::
HTTP_BAD_REQUEST
);
}
...
...
src/PotageBundle/Command/SendMailCommand.php
View file @
b0c49d46
...
...
@@ -18,7 +18,7 @@ class SendMailCommand extends ContainerAwareCommand
{
$this
->
setName
(
'potage:mail:send'
)
->
setDescription
(
"
Envoie un biess mail
!"
);
->
setDescription
(
"
Test d'envoi d'une infolettre
!"
);
}
public
$newsletter
;
...
...
src/PotageBundle/Controller/DefaultController.php
View file @
b0c49d46
...
...
@@ -60,6 +60,7 @@ class DefaultController extends MasterController
if
(
$form
->
isSubmitted
()
&&
$form
->
isValid
())
{
$retour
=
$newsletter
->
sendLettreToGroup
(
$lettre
);
}
return
$this
->
render
(
'@Potage/Default/test.html.twig'
,
array
(
...
...
Write
Preview
Markdown
is supported
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