1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00

Allow Conduit to query project slugs.

Summary: Ref T4418. Allow Conduit to query projects by their slugs.

Test Plan: This functionality mostly already existed, it just wasn't exposed to the Conduit endpoint.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T4418

Differential Revision: https://secure.phabricator.com/D9456
This commit is contained in:
Joshua Spence 2014-06-10 10:57:49 -07:00 committed by epriestley
parent d1626a3bad
commit 6df8c4a426

View file

@ -24,6 +24,7 @@ final class ConduitAPI_project_query_Method extends ConduitAPI_project_Method {
return array(
'ids' => 'optional list<int>',
'phids' => 'optional list<phid>',
'slugs' => 'optional list<string>',
'status' => 'optional '.$status_const,
'members' => 'optional list<phid>',
@ -38,8 +39,7 @@ final class ConduitAPI_project_query_Method extends ConduitAPI_project_Method {
}
public function defineErrorTypes() {
return array(
);
return array();
}
protected function execute(ConduitAPIRequest $request) {
@ -62,6 +62,11 @@ final class ConduitAPI_project_query_Method extends ConduitAPI_project_Method {
$query->withPHIDs($phids);
}
$slugs = $request->getValue('slugs');
if ($slugs) {
$query->withSlugs($slugs);
}
$members = $request->getValue('members');
if ($members) {
$query->withMemberPHIDs($members);