diff --git a/src/applications/phriction/conduit/PhrictionHistoryConduitAPIMethod.php b/src/applications/phriction/conduit/PhrictionHistoryConduitAPIMethod.php index 454af2934a..f030420594 100644 --- a/src/applications/phriction/conduit/PhrictionHistoryConduitAPIMethod.php +++ b/src/applications/phriction/conduit/PhrictionHistoryConduitAPIMethod.php @@ -1,53 +1,63 @@ 'required string', ); } protected function defineReturnType() { return 'nonempty list'; } protected function defineErrorTypes() { return array( 'ERR-BAD-DOCUMENT' => pht('No such document exists.'), ); } protected function execute(ConduitAPIRequest $request) { $slug = $request->getValue('slug'); $doc = id(new PhrictionDocumentQuery()) ->setViewer($request->getUser()) ->withSlugs(array(PhabricatorSlug::normalize($slug))) ->executeOne(); if (!$doc) { throw new ConduitException('ERR-BAD-DOCUMENT'); } $content = id(new PhrictionContent())->loadAllWhere( 'documentID = %d ORDER BY version DESC', $doc->getID()); $results = array(); foreach ($content as $version) { $results[] = $this->buildDocumentContentDictionary( $doc, $version); } return $results; } }