From d75cdfb94799269e97905e31183ed19963d1c9aa Mon Sep 17 00:00:00 2001
From: Sonia Zorba <zorba@oats.inaf.it>
Date: Wed, 19 Sep 2018 13:20:15 +0200
Subject: [PATCH] Modified /ws/join endpoint in order to return the remaining
 user id

---
 include/rest-web-service.php | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/rest-web-service.php b/include/rest-web-service.php
index b69161a..b0ffc19 100644
--- a/include/rest-web-service.php
+++ b/include/rest-web-service.php
@@ -102,7 +102,7 @@ Flight::route('POST ' . $WS_PREFIX . '/user', function() {
 });
 
 /**
- * Perform a join.
+ * Performs a join.
  */
 Flight::route('POST ' . $WS_PREFIX . '/join', function() {
 
@@ -111,7 +111,8 @@ Flight::route('POST ' . $WS_PREFIX . '/join', function() {
 
     $userHandler->joinUsers($postData['user1'], $postData['user2']);
 
-    echo "Success";
+    // if the join has success, returns the remaining user id
+    echo $postData['user1'];
 });
 
 Flight::route('GET ' . $WS_PREFIX . '/test', function() {
-- 
GitLab