diff --git a/bin/core/src/api/write/alerter.rs b/bin/core/src/api/write/alerter.rs index e66ccce4a..57739f414 100644 --- a/bin/core/src/api/write/alerter.rs +++ b/bin/core/src/api/write/alerter.rs @@ -50,6 +50,8 @@ impl Resolve for State { .await .context("failed to add alerter to db")? .inserted_id + .as_object_id() + .context("inserted_id is not ObjectId")? .to_string(); let alerter: Alerter = self.get_resource(&alerter_id).await?; @@ -112,6 +114,8 @@ impl Resolve for State { .await .context("failed to add alerter to db")? .inserted_id + .as_object_id() + .context("inserted_id is not ObjectId")? .to_string(); let alerter: Alerter = self.get_resource(&alerter_id).await?; diff --git a/bin/core/src/api/write/build.rs b/bin/core/src/api/write/build.rs index b04b569df..3f3a98370 100644 --- a/bin/core/src/api/write/build.rs +++ b/bin/core/src/api/write/build.rs @@ -60,6 +60,8 @@ impl Resolve for State { .await .context("failed to add build to db")? .inserted_id + .as_object_id() + .context("inserted_id is not ObjectId")? .to_string(); let build: Build = self.get_resource(&build_id).await?; @@ -125,6 +127,8 @@ impl Resolve for State { .await .context("failed to add build to db")? .inserted_id + .as_object_id() + .context("inserted_id is not ObjectId")? .to_string(); let build: Build = self.get_resource(&build_id).await?; diff --git a/bin/core/src/api/write/builder.rs b/bin/core/src/api/write/builder.rs index 96251ef68..802175761 100644 --- a/bin/core/src/api/write/builder.rs +++ b/bin/core/src/api/write/builder.rs @@ -46,6 +46,8 @@ impl Resolve for State { .await .context("failed to add builder to db")? .inserted_id + .as_object_id() + .context("inserted_id is not ObjectId")? .to_string(); let builder: Builder = self.get_resource(&builder_id).await?; let update = Update { @@ -112,6 +114,8 @@ impl Resolve for State { .await .context("failed to add builder to db")? .inserted_id + .as_object_id() + .context("inserted_id is not ObjectId")? .to_string(); let builder: Builder = self.get_resource(&builder_id).await?; let update = Update { diff --git a/bin/core/src/api/write/deployment.rs b/bin/core/src/api/write/deployment.rs index 9e01ec6ba..9724cde7b 100644 --- a/bin/core/src/api/write/deployment.rs +++ b/bin/core/src/api/write/deployment.rs @@ -72,6 +72,8 @@ impl Resolve for State { .await .context("failed to add deployment to db")? .inserted_id + .as_object_id() + .context("inserted_id is not ObjectId")? .to_string(); let deployment: Deployment = self.get_resource(&deployment_id).await?; @@ -153,6 +155,8 @@ impl Resolve for State { .await .context("failed to add deployment to db")? .inserted_id + .as_object_id() + .context("inserted_id is not ObjectId")? .to_string(); let deployment: Deployment = self.get_resource(&deployment_id).await?; diff --git a/bin/core/src/api/write/procedure.rs b/bin/core/src/api/write/procedure.rs index 889ce558e..0759943b1 100644 --- a/bin/core/src/api/write/procedure.rs +++ b/bin/core/src/api/write/procedure.rs @@ -47,6 +47,8 @@ impl Resolve for State { .await .context("failed to add procedure to db")? .inserted_id + .as_object_id() + .context("inserted_id is not ObjectId")? .to_string(); let procedure: Procedure = self.get_resource(&procedure_id).await?; @@ -113,6 +115,8 @@ impl Resolve for State { .await .context("failed to add build to db")? .inserted_id + .as_object_id() + .context("inserted_id is not ObjectId")? .to_string(); let procedure: Procedure = self.get_resource(&procedure_id).await?; diff --git a/bin/core/src/api/write/repo.rs b/bin/core/src/api/write/repo.rs index d515ba7bc..d27c57b0b 100644 --- a/bin/core/src/api/write/repo.rs +++ b/bin/core/src/api/write/repo.rs @@ -63,6 +63,8 @@ impl Resolve for State { .await .context("failed to add repo to db")? .inserted_id + .as_object_id() + .context("inserted_id is not ObjectId")? .to_string(); let repo: Repo = self.get_resource(&repo_id).await?; @@ -154,6 +156,8 @@ impl Resolve for State { .await .context("failed to add repo to db")? .inserted_id + .as_object_id() + .context("inserted_id is not ObjectId")? .to_string(); let repo: Repo = self.get_resource(&repo_id).await?; let update = Update { diff --git a/bin/core/src/api/write/server.rs b/bin/core/src/api/write/server.rs index 1d3058110..2b3862b70 100644 --- a/bin/core/src/api/write/server.rs +++ b/bin/core/src/api/write/server.rs @@ -54,6 +54,8 @@ impl Resolve for State { .await .context("failed to add server to db")? .inserted_id + .as_object_id() + .context("inserted_id is not ObjectId")? .to_string(); let server: Server = self.get_resource(&server_id).await?; let update = Update { diff --git a/bin/core/src/api/write/tag.rs b/bin/core/src/api/write/tag.rs index 26a573a6f..bb98e1ec8 100644 --- a/bin/core/src/api/write/tag.rs +++ b/bin/core/src/api/write/tag.rs @@ -37,6 +37,8 @@ impl Resolve for State { .await .context("failed to create tag on db")? .inserted_id + .as_object_id() + .context("inserted_id is not ObjectId")? .to_string(); Ok(tag) } diff --git a/bin/core/src/auth/github/mod.rs b/bin/core/src/auth/github/mod.rs index a0e3dd5b4..ea73985e1 100644 --- a/bin/core/src/auth/github/mod.rs +++ b/bin/core/src/auth/github/mod.rs @@ -87,6 +87,8 @@ async fn callback( .await .context("failed to create user on mongo")? .inserted_id + .as_object_id() + .context("inserted_id is not ObjectId")? .to_string(); state .jwt diff --git a/bin/core/src/auth/google/mod.rs b/bin/core/src/auth/google/mod.rs index 3c8a4155e..7395f6488 100644 --- a/bin/core/src/auth/google/mod.rs +++ b/bin/core/src/auth/google/mod.rs @@ -111,6 +111,8 @@ async fn callback( .await .context("failed to create user on mongo")? .inserted_id + .as_object_id() + .context("inserted_id is not ObjectId")? .to_string(); state .jwt diff --git a/bin/core/src/auth/local.rs b/bin/core/src/auth/local.rs index 55966a16e..d86320dbc 100644 --- a/bin/core/src/auth/local.rs +++ b/bin/core/src/auth/local.rs @@ -52,6 +52,8 @@ impl Resolve for State { .await .context("failed to create user")? .inserted_id + .as_object_id() + .context("inserted_id is not ObjectId")? .to_string(); let jwt = self