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:
committed by
epriestley
parent
d1626a3bad
commit
6df8c4a426
@@ -24,6 +24,7 @@ final class ConduitAPI_project_query_Method extends ConduitAPI_project_Method {
|
|||||||
return array(
|
return array(
|
||||||
'ids' => 'optional list<int>',
|
'ids' => 'optional list<int>',
|
||||||
'phids' => 'optional list<phid>',
|
'phids' => 'optional list<phid>',
|
||||||
|
'slugs' => 'optional list<string>',
|
||||||
'status' => 'optional '.$status_const,
|
'status' => 'optional '.$status_const,
|
||||||
|
|
||||||
'members' => 'optional list<phid>',
|
'members' => 'optional list<phid>',
|
||||||
@@ -38,8 +39,7 @@ final class ConduitAPI_project_query_Method extends ConduitAPI_project_Method {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function defineErrorTypes() {
|
public function defineErrorTypes() {
|
||||||
return array(
|
return array();
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function execute(ConduitAPIRequest $request) {
|
protected function execute(ConduitAPIRequest $request) {
|
||||||
@@ -62,6 +62,11 @@ final class ConduitAPI_project_query_Method extends ConduitAPI_project_Method {
|
|||||||
$query->withPHIDs($phids);
|
$query->withPHIDs($phids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$slugs = $request->getValue('slugs');
|
||||||
|
if ($slugs) {
|
||||||
|
$query->withSlugs($slugs);
|
||||||
|
}
|
||||||
|
|
||||||
$members = $request->getValue('members');
|
$members = $request->getValue('members');
|
||||||
if ($members) {
|
if ($members) {
|
||||||
$query->withMemberPHIDs($members);
|
$query->withMemberPHIDs($members);
|
||||||
|
|||||||
Reference in New Issue
Block a user