We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 34e5ba2 commit 472c001Copy full SHA for 472c001
src/schema/mod.rs
@@ -996,6 +996,25 @@ impl MutationRoot {
996
Ok(Climb(id))
997
}
998
999
+ async fn move_crag(
1000
+ &self,
1001
+ ctx: &Context<'_>,
1002
+ id: ID,
1003
+ region_id: Option<ID>
1004
+ ) -> Result<Crag> {
1005
+ let db_client = ctx.db_client().await?;
1006
+
1007
+ let id: i32 = id.parse()?;
1008
+ let region_id: Option<i32> = region_id.map(|r| r.parse()).transpose()?;
1009
1010
+ let _ = db_client.execute(
1011
+ "
1012
+ UPDATE climb.crags SET region_id = $1 WHERE id = $2
1013
+ ", &[®ion_id, &id]).await;
1014
1015
+ Ok(Crag(id))
1016
+ }
1017
1018
async fn add_climb_grade(
1019
&self,
1020
ctx: &Context<'_>,
0 commit comments