mirror of
https://github.com/moghtech/komodo.git
synced 2026-03-11 17:44:19 -05:00
inserted_id as_object_id first before to_string
This commit is contained in:
@@ -50,6 +50,8 @@ impl Resolve<CreateAlerter, RequestUser> 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<CopyAlerter, RequestUser> 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?;
|
||||
|
||||
|
||||
@@ -60,6 +60,8 @@ impl Resolve<CreateBuild, RequestUser> 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<CopyBuild, RequestUser> 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?;
|
||||
|
||||
|
||||
@@ -46,6 +46,8 @@ impl Resolve<CreateBuilder, RequestUser> 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<CopyBuilder, RequestUser> 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 {
|
||||
|
||||
@@ -72,6 +72,8 @@ impl Resolve<CreateDeployment, RequestUser> 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<CopyDeployment, RequestUser> 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?;
|
||||
|
||||
@@ -47,6 +47,8 @@ impl Resolve<CreateProcedure, RequestUser> 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<CopyProcedure, RequestUser> 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?;
|
||||
|
||||
@@ -63,6 +63,8 @@ impl Resolve<CreateRepo, RequestUser> 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<CopyRepo, RequestUser> 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 {
|
||||
|
||||
@@ -54,6 +54,8 @@ impl Resolve<CreateServer, RequestUser> 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 {
|
||||
|
||||
@@ -37,6 +37,8 @@ impl Resolve<CreateTag, RequestUser> 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)
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -52,6 +52,8 @@ impl Resolve<CreateLocalUser> for State {
|
||||
.await
|
||||
.context("failed to create user")?
|
||||
.inserted_id
|
||||
.as_object_id()
|
||||
.context("inserted_id is not ObjectId")?
|
||||
.to_string();
|
||||
|
||||
let jwt = self
|
||||
|
||||
Reference in New Issue
Block a user