API: add GET api/z/1.0/abook

This commit is contained in:
zotlabs 2016-11-14 17:47:44 -08:00
parent 078db2dd80
commit 9055d0910c

View File

@ -33,6 +33,8 @@
api_register_func('api/red/item/full','red_item', true);
api_register_func('api/z/1.0/item/full','red_item', true);
api_register_func('api/z/1.0/abook','api_zot_abook_xchan',true);
return;
}
@ -268,6 +270,23 @@
json_return_and_die($r);
};
function api_zot_abook_xchan($type) {
logger('api_abook_xchan');
if(api_user() === false)
return false;
$sql_extra = ((array_key_exists('abook_id',$_REQUEST) && intval($_REQUEST['abook_id'])) ? ' and abook_id = ' . intval($_REQUEST['abook_id']) . ' ' : '');
if($_SERVER['REQUEST_METHOD'] === 'POST') {
// update
}
$r = q("select * from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d $sql_extra ",
intval(api_user())
);
json_return_and_die($r);
};
function red_item_new($type) {