Skip to content

Commit

Permalink
Status fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alanvardy committed Nov 20, 2023
1 parent c5a4d08 commit 782a989
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- Fix bug on querying statuses (position can be a float)

## 2023-11-20 v0.1.8

- Select status on `issue create` and `template evaluate`
Expand Down
4 changes: 2 additions & 2 deletions src/team.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub struct StateNode {
pub struct State {
pub name: String,
pub id: String,
pub position: u32,
pub position: f32,
}

impl Display for State {
Expand All @@ -75,7 +75,7 @@ pub fn get_states(config: &Config, token: &str, team: &Team) -> Result<Vec<State
match result {
Ok(body) => {
let mut states = body.data.team.states.unwrap().nodes;
states.sort_unstable_by_key(|s| s.position);
states.sort_unstable_by_key(|s| s.position as i32);
Ok(states)
}
Err(err) => Err(format!("Could not parse response for states: {err:?}")),
Expand Down
2 changes: 2 additions & 0 deletions src/template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const ISSUE_CREATE_DOC: &str = "mutation (
$assigneeId: String
$description: String,
$parentId: String
$stateId: String
$projectId: String
) {
issueCreate(
Expand All @@ -30,6 +31,7 @@ const ISSUE_CREATE_DOC: &str = "mutation (
priority: $priority
teamId: $teamId
assigneeId: $assigneeId
stateId: $stateId
description: $description
parentId: $parentId
projectId: $projectId
Expand Down
2 changes: 1 addition & 1 deletion src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub mod fixtures {
State {
name: "Thundercats".to_string(),
id: "123456".to_string(),
position: 1,
position: 1.0,
}
}
}
Expand Down

0 comments on commit 782a989

Please sign in to comment.