Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
La Quadrature du Net
piphone
piphone-front
Commits
d8792629
Commit
d8792629
authored
Aug 17, 2016
by
okhin
Browse files
Adding the /campaigns/id/contacts/id call to the FakeApi
parent
ac9eae6d
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/RestApi.php
View file @
d8792629
...
...
@@ -21,6 +21,16 @@ class RestApi {
echo
$this
->
return_datas
(
'app/datas/contacts.json'
);
}
function
contact
(
$f3
,
$args
)
{
$contacts
=
json_decode
(
$this
->
return_datas
(
'app/datas/contacts.json'
,
true
));
foreach
(
$contacts
as
$contact
)
{
if
(
$contact
->
id
==
$args
[
'cid'
]
)
{
echo
json_encode
(
$contact
);
return
;
}
};
}
function
categories
(
$f3
,
$args
)
{
// List of feedback categories
echo
'{"categories": [
...
...
app/routes.ini
View file @
d8792629
...
...
@@ -10,6 +10,7 @@ GET @argumentation:/argumentation=Main->argumentation
; Fake REST API
GET
/restapi/campaigns/@
id
=
RestApi->campaign
GET
/restapi/campaigns/@id/
contacts
=
RestApi->contacts
GET
/restapi/campaigns/@id/contacts/@
cid
=
RestApi->contact
GET
/restapi/campaigns/@id/feedback/
categories
=
RestApi->categories
POST
/restapi/campaigns/@id/feedback/
add
=
RestApi->feedback_add
GET
/restapi/campaigns/@id/arguments/@
lang
=
RestApi->arguments
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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