1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02:00

Add "uri" to "paste.search" API output

Summary: Ref T13490. This simplifies some client behavior in the general case.

Test Plan: Called API method, saw URIs.

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21105
This commit is contained in:
epriestley 2020-04-13 14:14:32 -07:00
parent 19e0abcb27
commit 471e89a8b7
2 changed files with 9 additions and 0 deletions

View file

@ -1052,6 +1052,10 @@ final class DifferentialRevision extends DifferentialDAO
->setKey('title') ->setKey('title')
->setType('string') ->setType('string')
->setDescription(pht('The revision title.')), ->setDescription(pht('The revision title.')),
id(new PhabricatorConduitSearchFieldSpecification())
->setKey('uri')
->setType('uri')
->setDescription(pht('View URI for the revision.')),
id(new PhabricatorConduitSearchFieldSpecification()) id(new PhabricatorConduitSearchFieldSpecification())
->setKey('authorPHID') ->setKey('authorPHID')
->setType('phid') ->setType('phid')

View file

@ -241,6 +241,10 @@ final class PhabricatorPaste extends PhabricatorPasteDAO
->setKey('title') ->setKey('title')
->setType('string') ->setType('string')
->setDescription(pht('The title of the paste.')), ->setDescription(pht('The title of the paste.')),
id(new PhabricatorConduitSearchFieldSpecification())
->setKey('uri')
->setType('uri')
->setDescription(pht('View URI for the paste.')),
id(new PhabricatorConduitSearchFieldSpecification()) id(new PhabricatorConduitSearchFieldSpecification())
->setKey('authorPHID') ->setKey('authorPHID')
->setType('phid') ->setType('phid')
@ -259,6 +263,7 @@ final class PhabricatorPaste extends PhabricatorPasteDAO
public function getFieldValuesForConduit() { public function getFieldValuesForConduit() {
return array( return array(
'title' => $this->getTitle(), 'title' => $this->getTitle(),
'uri' => PhabricatorEnv::getURI($this->getURI()),
'authorPHID' => $this->getAuthorPHID(), 'authorPHID' => $this->getAuthorPHID(),
'language' => nonempty($this->getLanguage(), null), 'language' => nonempty($this->getLanguage(), null),
'status' => $this->getStatus(), 'status' => $this->getStatus(),