Radish alpha
r
rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5
Radicle web interface
Radicle
Git
http: Rename `IssueState` and `PatchState` to `IssueStatus` and `PatchState`
Sebastian Martinez committed 1 year ago
commit 7347d031e7dd32b0e03db704a062c9d300bde168
parent 49a299f
2 files changed +6 -6
modified radicle-httpd/src/api.rs
@@ -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 { .. }),
modified radicle-httpd/src/api/v1/projects.rs
@@ -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 {