Commit d8792629 authored by okhin's avatar okhin 🚴

Adding the /campaigns/id/contacts/id call to the FakeApi

parent ac9eae6d
......@@ -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": [
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment