diff options
author | tomneedham <tom@owncloud.com> | 2013-11-14 00:41:04 +0000 |
---|---|---|
committer | tomneedham <tom@owncloud.com> | 2013-11-14 00:41:04 +0000 |
commit | b06682b7fb6ccc09fef55da2bb47d8e1612130d9 (patch) | |
tree | ed47c44c90146ee347d9b888b5b71c154a4b473b /lib/private/api.php | |
parent | 00944a376a83695256f91f800bece1d2de10b89e (diff) | |
parent | 17e45e20021084f84d07d0c7590ebc2645b5d889 (diff) | |
download | nextcloud-server-b06682b7fb6ccc09fef55da2bb47d8e1612130d9.tar.gz nextcloud-server-b06682b7fb6ccc09fef55da2bb47d8e1612130d9.zip |
Merge branch 'ocs_api_fix_success_code' into oc_api_tests
Diffstat (limited to 'lib/private/api.php')
-rw-r--r-- | lib/private/api.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/private/api.php b/lib/private/api.php index ac9bb8b0688..45e7f18bd4e 100644 --- a/lib/private/api.php +++ b/lib/private/api.php @@ -173,7 +173,7 @@ class OC_API { $response = reset($thirdparty['failed']); return $response; } else { - $responses = array_merge($shipped['succeeded'], $thirdparty['succeeded']); + $responses = $thirdparty['succeeded']; } // Merge the successful responses $meta = array(); @@ -185,8 +185,19 @@ class OC_API { } else { $data = array_merge_recursive($data, $response['response']->getData()); } + $codes[] = $response->getStatusCode(); + } + + // Use any non 100 status codes + $statusCode = 100; + foreach($codes as $code) { + if($code != 100) { + $statusCode = $code; + break; + } } - $result = new OC_OCS_Result($data, 100); + + $result = new OC_OCS_Result($data, $statusCode); return $result; } |