http: Rename IssueState and PatchState to IssueStatus and PatchState

This commit is contained in:
Sebastian Martinez
2024-07-04 15:21:10 +02:00
parent 49a299f9e3
commit 7347d031e7
2 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -173,14 +173,14 @@ pub struct PoliciesQuery {
#[derive(Default, Serialize, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub enum IssueState {
pub enum IssueStatus {
Closed,
#[default]
Open,
All,
}
impl IssueState {
impl IssueStatus {
pub fn matches(&self, issue: &issue::State) -> bool {
match self {
Self::Open => matches!(issue, issue::State::Open),
@@ -192,7 +192,7 @@ impl IssueState {
#[derive(Default, Serialize, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub enum PatchState {
pub enum PatchStatus {
#[default]
Open,
Draft,
@@ -201,7 +201,7 @@ pub enum PatchState {
All,
}
impl PatchState {
impl PatchStatus {
pub fn matches(&self, patch: &patch::State) -> bool {
match self {
Self::Open => matches!(patch, patch::State::Open { .. }),
+2 -2
View File
@@ -606,7 +606,7 @@ async fn readme_handler(
async fn issues_handler(
State(ctx): State<Context>,
Path(project): Path<RepoId>,
Query(qs): Query<CobsQuery<api::IssueState>>,
Query(qs): Query<CobsQuery<api::IssueStatus>>,
) -> impl IntoResponse {
let (repo, _) = ctx.repo(project)?;
let CobsQuery {
@@ -660,7 +660,7 @@ async fn issue_handler(
async fn patches_handler(
State(ctx): State<Context>,
Path(rid): Path<RepoId>,
Query(qs): Query<CobsQuery<api::PatchState>>,
Query(qs): Query<CobsQuery<api::PatchStatus>>,
) -> impl IntoResponse {
let (repo, _) = ctx.repo(rid)?;
let CobsQuery {