@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[easy] Add support for fetching all packages to owners.query

Summary: as title

Test Plan: tested without params. Tested with single known path

Reviewers: epriestley, vrana, nh

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3139

mkedia 48806b5e 9b8a2cbf

+10 -3
+10 -3
src/applications/conduit/method/owners/ConduitAPI_owners_query_Method.php
··· 54 54 ); 55 55 } 56 56 57 + protected static function queryAll() { 58 + return id(new PhabricatorOwnersPackage())->loadAll(); 59 + } 60 + 57 61 protected static function queryByOwner($owner) { 58 62 $is_valid_phid = 59 63 phid_get_type($owner) == PhabricatorPHIDConstants::PHID_TYPE_USER || ··· 152 156 $path = $request->getValue('path'); 153 157 $is_path_query = ($repo && $path) ? 1 : 0; 154 158 155 - // exactly one of these should be provided 156 - if ($is_owner_query + $is_path_query + $is_affiliated_query !== 1) { 159 + if ($is_owner_query + $is_path_query + $is_affiliated_query === 0) { 160 + // if no search terms are provided, return everything 161 + $packages = self::queryAll(); 162 + } else if ($is_owner_query + $is_path_query + $is_affiliated_query > 1) { 163 + // otherwise, exactly one of these should be provided 157 164 throw new ConduitException('ERR-INVALID-USAGE'); 158 165 } 159 166 ··· 168 175 169 176 $packages = self::queryByOwner($owner); 170 177 171 - } else { 178 + } else if ($is_path_query) { 172 179 $packages = self::queryByPath($repo, $path); 173 180 } 174 181