mirror of
https://gitlab.linphone.org/BC/public/flexisip-account-manager.git
synced 2026-01-17 10:08:05 +00:00
Fix FLEXIAPI-362 Return an empty object and not an empty array in the...
This commit is contained in:
parent
1a79ae7b16
commit
507e913241
3 changed files with 10 additions and 1 deletions
|
|
@ -66,6 +66,7 @@ v2.0
|
||||||
- Fix FLEXIAPI-355 Add withoutGlobalScope() to the Account ContactVcardList resolver
|
- Fix FLEXIAPI-355 Add withoutGlobalScope() to the Account ContactVcardList resolver
|
||||||
- Fix FLEXIAPI-354 Fix contact deletion
|
- Fix FLEXIAPI-354 Fix contact deletion
|
||||||
- Fix FLEXIAPI-360 Add rules on some jobs to only run them in the Gitlab pipeline when needed
|
- Fix FLEXIAPI-360 Add rules on some jobs to only run them in the Gitlab pipeline when needed
|
||||||
|
- Fix FLEXIAPI-362 Return an empty object and not an empty array in the vcards-storage index endpoint to prevent some parsing issues in the clients
|
||||||
|
|
||||||
v1.6
|
v1.6
|
||||||
----
|
----
|
||||||
|
|
|
||||||
|
|
@ -26,12 +26,14 @@ use App\VcardStorage;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
use Sabre\VObject;
|
use Sabre\VObject;
|
||||||
|
use stdClass;
|
||||||
|
|
||||||
class VcardsStorageController extends Controller
|
class VcardsStorageController extends Controller
|
||||||
{
|
{
|
||||||
public function index(int $accountId)
|
public function index(int $accountId)
|
||||||
{
|
{
|
||||||
return Account::findOrFail($accountId)->vcardsStorage()->get()->keyBy('uuid');
|
$list = Account::findOrFail($accountId)->vcardsStorage()->get()->keyBy('uuid');
|
||||||
|
return $list->isEmpty() ? new stdClass : $list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function show(int $accountId, string $uuid)
|
public function show(int $accountId, string $uuid)
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,12 @@ UID:' . $uid3 . '
|
||||||
END:VCARD
|
END:VCARD
|
||||||
';
|
';
|
||||||
|
|
||||||
|
// Empty
|
||||||
|
$this->keyAuthenticated($account)
|
||||||
|
->get($this->route)
|
||||||
|
->assertStatus(200)
|
||||||
|
->assertSee('{}');
|
||||||
|
|
||||||
// Missing vcard
|
// Missing vcard
|
||||||
$this->keyAuthenticated($account)
|
$this->keyAuthenticated($account)
|
||||||
->json($this->method, $this->route, [
|
->json($this->method, $this->route, [
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue