Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
piphone-front
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
La Quadrature du Net
piphone
piphone-front
Commits
d8792629
Commit
d8792629
authored
Aug 17, 2016
by
okhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding the /campaigns/id/contacts/id call to the FakeApi
parent
ac9eae6d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
app/RestApi.php
app/RestApi.php
+10
-0
app/routes.ini
app/routes.ini
+1
-0
No files found.
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
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