mirror of
https://github.com/railwayapp/cli
synced 2026-04-21 14:07:23 +00:00
feat(delete): use projectScheduleDelete mutation for soft deletion (#827)
Switch from immediate `projectDelete` to `projectScheduleDelete` which provides a 48-hour grace period before the project is permanently removed. Made-with: Cursor
This commit is contained in:
parent
5b75f1884c
commit
898a59d63a
4 changed files with 8 additions and 7 deletions
|
|
@ -69,11 +69,12 @@ pub async fn command(args: Args) -> Result<()> {
|
|||
|
||||
let spinner = create_spinner_if(!args.json, "Deleting project...".into());
|
||||
|
||||
let vars = mutations::project_delete::Variables {
|
||||
let vars = mutations::project_schedule_delete::Variables {
|
||||
id: project_id.clone(),
|
||||
};
|
||||
|
||||
post_graphql::<mutations::ProjectDelete, _>(&client, &configs.get_backboard(), vars).await?;
|
||||
post_graphql::<mutations::ProjectScheduleDelete, _>(&client, &configs.get_backboard(), vars)
|
||||
.await?;
|
||||
|
||||
if args.json {
|
||||
println!("{}", serde_json::json!({"id": project_id}));
|
||||
|
|
|
|||
|
|
@ -36,10 +36,10 @@ pub struct ProjectCreate;
|
|||
#[derive(GraphQLQuery)]
|
||||
#[graphql(
|
||||
schema_path = "src/gql/schema.json",
|
||||
query_path = "src/gql/mutations/strings/ProjectDelete.graphql",
|
||||
query_path = "src/gql/mutations/strings/ProjectScheduleDelete.graphql",
|
||||
response_derives = "Debug, Serialize, Clone"
|
||||
)]
|
||||
pub struct ProjectDelete;
|
||||
pub struct ProjectScheduleDelete;
|
||||
|
||||
#[derive(GraphQLQuery)]
|
||||
#[graphql(
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
mutation ProjectDelete($id: String!) {
|
||||
projectDelete(id: $id)
|
||||
}
|
||||
3
src/gql/mutations/strings/ProjectScheduleDelete.graphql
Normal file
3
src/gql/mutations/strings/ProjectScheduleDelete.graphql
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
mutation ProjectScheduleDelete($id: String!) {
|
||||
projectScheduleDelete(id: $id)
|
||||
}
|
||||
Loading…
Reference in a new issue