mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-16 03:40:37 +08:00
http: Rename IssueState and PatchState to IssueStatus and PatchState
This commit is contained in:
@@ -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 { .. }),
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user