1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2024-11-29 11:24:11 +01:00

Only return collection on GET.

Opens up for using HEAD to get status.
This commit is contained in:
Thomas Tanghus 2013-05-27 08:04:06 +02:00
parent ae095acb2b
commit dfefa2be55

View File

@ -60,15 +60,17 @@ class AddressBookController extends BaseController {
$response->setETag(md5($lastModified));
}
$contacts = array();
foreach($addressBook->getChildren() as $i => $contact) {
$result = JSONSerializer::serializeContact($contact);
//\OCP\Util::writeLog('contacts', __METHOD__.' contact: '.print_r($result, true), \OCP\Util::DEBUG);
if($result !== null) {
$contacts[] = $result;
if($this->request->method === 'GET') {
$contacts = array();
foreach($addressBook->getChildren() as $i => $contact) {
$result = JSONSerializer::serializeContact($contact);
//\OCP\Util::writeLog('contacts', __METHOD__.' contact: '.print_r($result, true), \OCP\Util::DEBUG);
if($result !== null) {
$contacts[] = $result;
}
}
$response->setParams(array('contacts' => $contacts));
}
$response->setParams(array('contacts' => $contacts));
return $response;
}