mirror of
https://gitlab.linphone.org/BC/public/flexisip-account-manager.git
synced 2026-01-17 01:58:07 +00:00
Fix FLEXIAPI-378 Return a valid JSON containing the vCard and not the raw...
This commit is contained in:
parent
ee2c9fed8f
commit
abe67c9734
3 changed files with 20 additions and 7 deletions
|
|
@ -8,6 +8,7 @@ v2.1
|
|||
- Fix FLEXIAPI-374 Improve CardDav credentials form
|
||||
- Fix FLEXIAPI-376 Rename domain to realm in CardDav credentials
|
||||
- Fix FLEXIAPI-375 Fix VcardsStorage table UUID size, recover the UUID from the stored vCard
|
||||
- Fix FLEXIAPI-378 Return a valid JSON containing the vCard and not the raw vCard in VcardsStorage controller
|
||||
|
||||
v2.0
|
||||
----
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ class VcardsStorageController extends Controller
|
|||
$vcard->vcard = preg_replace('/\r\n?/', "\n", $vcardo->serialize());
|
||||
$vcard->save();
|
||||
|
||||
return $vcard->vcard;
|
||||
return $vcard;
|
||||
}
|
||||
|
||||
public function update(Request $request, int $accountId, string $uuid)
|
||||
|
|
@ -78,7 +78,7 @@ class VcardsStorageController extends Controller
|
|||
$vcard->vcard = preg_replace('/\r\n?/', "\n", $vcardo->serialize());
|
||||
$vcard->save();
|
||||
|
||||
return $vcard->vcard;
|
||||
return $vcard;
|
||||
}
|
||||
|
||||
public function destroy(int $accountId, string $uuid)
|
||||
|
|
|
|||
|
|
@ -101,13 +101,23 @@ VERSION:4.0
|
|||
FN:Simon Perreault
|
||||
UID:' . $uid . '
|
||||
END:VCARD'
|
||||
])->assertStatus(200);
|
||||
])->assertJsonFragment([
|
||||
'vcard' =>
|
||||
'BEGIN:VCARD
|
||||
VERSION:4.0
|
||||
FN:Simon Perreault
|
||||
UID:' . $uid . '
|
||||
END:VCARD
|
||||
'
|
||||
])->assertStatus(201);
|
||||
|
||||
// Admin create
|
||||
$this->keyAuthenticated($admin)
|
||||
->json($this->method, $adminRoute, [
|
||||
'vcard' => $thirdVcard])
|
||||
->assertStatus(200);
|
||||
->assertJson([
|
||||
'vcard' => $thirdVcard
|
||||
])->assertStatus(201);
|
||||
|
||||
// Again...
|
||||
$this->keyAuthenticated($account)
|
||||
|
|
@ -123,7 +133,7 @@ END:VCARD'
|
|||
$this->keyAuthenticated($account)
|
||||
->json($this->method, $this->route, [
|
||||
'vcard' => $secondVcard
|
||||
])->assertStatus(200);
|
||||
])->assertStatus(201);
|
||||
|
||||
$this->assertDatabaseHas('vcards_storage', [
|
||||
'uuid' => $uid
|
||||
|
|
@ -141,6 +151,8 @@ END:VCARD'
|
|||
$this->keyAuthenticated($account)
|
||||
->json('PUT', $this->route . '/' . $uid, [
|
||||
'vcard' => $lastVcard
|
||||
])->assertJsonFragment([
|
||||
'vcard' => $lastVcard
|
||||
])->assertStatus(200);
|
||||
|
||||
// Update with wrong UID
|
||||
|
|
@ -167,7 +179,7 @@ END:VCARD'
|
|||
$this->keyAuthenticated($account)
|
||||
->get($this->route . '/' . $uid)
|
||||
->assertStatus(200)
|
||||
->assertJson([
|
||||
->assertJsonFragment([
|
||||
'vcard' => $lastVcard
|
||||
]);
|
||||
|
||||
|
|
@ -175,7 +187,7 @@ END:VCARD'
|
|||
$this->keyAuthenticated($admin)
|
||||
->get($adminRoute . '/' . $uid)
|
||||
->assertStatus(200)
|
||||
->assertJson([
|
||||
->assertJsonFragment([
|
||||
'vcard' => $lastVcard
|
||||
]);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue