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
nico
piphone-front
Commits
5a1135aa
Commit
5a1135aa
authored
Nov 23, 2014
by
Mindiell
Browse files
Cleaning of fake REST API
parent
c4a724f9
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/RestApi.php
View file @
5a1135aa
...
...
@@ -21,56 +21,6 @@ class RestApi {
echo
$this
->
return_datas
(
'app/datas/contacts.json'
);
}
function
contact
(
$f3
,
$args
)
{
if
(
$f3
->
exists
(
'PARAMS.contact'
))
{
// Specified contact
}
else
{
// Random contact
echo
'{
"id": "4123",
"last_name": "ANDERSDOTTER",
"first_name": "Amelia",
"tel": "+322 28 45922",
"groups": [
{
"type": "Political group",
"name": "Greens/EFA",
"media": ""
},
{
"type": "National party",
"name": "Piratpartiet",
"media": ""
},
{
"type": "Country",
"name": "SE",
"media": ""
},
{
"type": "Committee",
"name": "ITRE",
"media": ""
},
{
"type": "Committee",
"name": "INTA",
"media": ""
},
{
"type": "Committee",
"name": "CONT",
"media": ""
}
]
}'
;
}
}
function
groups
(
$f3
,
$args
)
{
// List of groups available
}
function
categories
(
$f3
,
$args
)
{
// List of feedback categories
echo
'{"categories": [
...
...
app/routes.ini
View file @
5a1135aa
...
...
@@ -8,12 +8,9 @@ POST @feedbacksip:/feedbacksip=Main->feedbacksip
GET
@salespitch:/
salespitch
=
Main->salespitch
; Fake REST API
GET
/restapi/campaign/@
id
=
RestApi->campaign
GET
/restapi/campaign/@id/
contacts
=
RestApi->contacts
GET
/restapi/campaign/@id/
contact
=
RestApi->contact
GET
/restapi/campaign/@id/contact/@
contact
=
RestApi->contact
GET
/restapi/campaign/@id/
groups
=
RestApi->groups
GET
/restapi/campaign/@id/feedback/
categories
=
RestApi->categories
POST
/restapi/campaign/@id/feedback/
add
=
RestApi->feedback_add
GET
/restapi/campaign/@id/arguments/@
lang
=
RestApi->arguments
GET
/restapi/campaigns/@
id
=
RestApi->campaign
GET
/restapi/campaigns/@id/
contacts
=
RestApi->contacts
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