Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
fix missed queries
Browse files Browse the repository at this point in the history
  • Loading branch information
darling committed Nov 23, 2023
1 parent 5dbbf28 commit 2bc9ca6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/database/models/oauth_client_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,14 @@ impl OAuthClient {
sqlx::query!(
"
UPDATE oauth_clients
SET name = $1, icon_url = $2, max_scopes = $3
WHERE (id = $4)
SET name = $1, icon_url = $2, max_scopes = $3, url = $4, description = $5
WHERE (id = $6)
",
self.name,
self.icon_url,
self.max_scopes.to_postgres(),
self.url,
self.description,
self.id.0,
)
.execute(exec)
Expand Down
10 changes: 8 additions & 2 deletions src/routes/v3/oauth_clients.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ pub struct NewOAuthApp {

pub redirect_uris: Vec<String>,

#[validate(custom(function = "crate::util::validate::validate_url"))]
#[validate(
custom(function = "crate::util::validate::validate_url"),
length(max = 255)
)]
pub url: Option<String>,

#[validate(length(max = 255))]
Expand Down Expand Up @@ -261,7 +264,10 @@ pub struct OAuthClientEdit {
#[validate(length(min = 1))]
pub redirect_uris: Option<Vec<String>>,

#[validate(custom(function = "crate::util::validate::validate_url"))]
#[validate(
custom(function = "crate::util::validate::validate_url"),
length(max = 255)
)]
pub url: Option<Option<String>>,

#[validate(length(max = 255))]
Expand Down

0 comments on commit 2bc9ca6

Please sign in to comment.