Improved API datasets

This commit is contained in:
Michael 2021-01-17 14:57:55 +00:00
parent 0c8bb0bc18
commit d78892fc1b
2 changed files with 14 additions and 2 deletions

View File

@ -1964,12 +1964,12 @@ function api_conversation_show($type)
Logger::info(API_LOG_PREFIX . '{subaction}', ['module' => 'api', 'action' => 'conversation', 'subaction' => 'show', 'id' => $id]);
// try to fetch the item for the local user - or the public item, if there is no local one
$item = Post::selectFirst(['parent-uri'], ['id' => $id]);
$item = Post::selectFirst(['parent-uri-id'], ['id' => $id]);
if (!DBA::isResult($item)) {
throw new BadRequestException("There is no status with this id.");
}
$parent = Post::selectFirst(['id'], ['uri' => $item['parent-uri'], 'uid' => [0, api_user()]], ['order' => ['uid' => true]]);
$parent = Post::selectFirst(['id'], ['uri-id' => $item['parent-uri-id'], 'uid' => [0, api_user()]], ['order' => ['uid' => true]]);
if (!DBA::isResult($parent)) {
throw new BadRequestException("There is no status with this id.");
}

View File

@ -194,6 +194,8 @@ return [
'body' => 'Parent status',
'parent' => 1,
'parent-uri-id' => 1,
'thr-parent-id' => 1,
'gravity' => GRAVITY_PARENT,
'author-link' => 'http://localhost/profile/selfcontact',
'wall' => 1,
'starred' => 1,
@ -219,6 +221,8 @@ return [
'body' => 'Reply',
'parent' => 1,
'parent-uri-id' => 1,
'thr-parent-id' => 1,
'gravity' => GRAVITY_COMMENT,
'author-link' => 'http://localhost/profile/selfcontact',
'wall' => 1,
'starred' => 0,
@ -241,6 +245,8 @@ return [
'body' => 'Other user status',
'parent' => 3,
'parent-uri-id' => 3,
'thr-parent-id' => 3,
'gravity' => GRAVITY_PARENT,
'author-link' => 'http://localhost/profile/othercontact',
'wall' => 1,
'starred' => 0,
@ -262,6 +268,8 @@ return [
'body' => 'Friend user reply',
'parent' => 1,
'parent-uri-id' => 1,
'thr-parent-id' => 1,
'gravity' => GRAVITY_COMMENT,
'author-link' => 'http://localhost/profile/othercontact',
'wall' => 1,
'starred' => 0,
@ -284,6 +292,8 @@ return [
'body' => '[share]Shared status[/share]',
'parent' => 1,
'parent-uri-id' => 1,
'thr-parent-id' => 1,
'gravity' => GRAVITY_COMMENT,
'author-link' => 'http://localhost/profile/othercontact',
'wall' => 1,
'starred' => 0,
@ -309,6 +319,8 @@ return [
'body' => 'Friend user status',
'parent' => 6,
'parent-uri-id' => 6,
'thr-parent-id' => 6,
'gravity' => GRAVITY_PARENT,
'author-link' => 'http://localhost/profile/othercontact',
'wall' => 1,
'starred' => 0,