Even single shares are returned as array
When fetching a single share using ../shares/<ID> we should still return an array of shares. Fixes #22189
This commit is contained in:
parent
4130639a7e
commit
ca32778975
|
@ -170,7 +170,7 @@ class Share20OCS {
|
||||||
|
|
||||||
if ($this->canAccessShare($share)) {
|
if ($this->canAccessShare($share)) {
|
||||||
$share = $this->formatShare($share);
|
$share = $this->formatShare($share);
|
||||||
return new \OC_OCS_Result($share);
|
return new \OC_OCS_Result([$share]);
|
||||||
} else {
|
} else {
|
||||||
return new \OC_OCS_Result(null, 404, 'wrong share ID, share doesn\'t exist.');
|
return new \OC_OCS_Result(null, 404, 'wrong share ID, share doesn\'t exist.');
|
||||||
}
|
}
|
||||||
|
|
|
@ -387,7 +387,7 @@ class Share20OCSTest extends \Test\TestCase {
|
||||||
['group', $group],
|
['group', $group],
|
||||||
]));
|
]));
|
||||||
|
|
||||||
$expected = new \OC_OCS_Result($result);
|
$expected = new \OC_OCS_Result([$result]);
|
||||||
$this->assertEquals($expected->getData(), $ocs->getShare($share->getId())->getData());
|
$this->assertEquals($expected->getData(), $ocs->getShare($share->getId())->getData());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue