Skip to content

Commit

Permalink
fix api endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed May 22, 2024
1 parent 031d3a0 commit e2b753d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/panelapi/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4149,10 +4149,11 @@ async fn query(

// Insert entry
sqlx::query!(
"INSERT INTO shop_item_benefits (id, name, description) VALUES ($1, $2, $3)",
"INSERT INTO shop_item_benefits (id, name, description, created_by) VALUES ($1, $2, $3, $4)",
id,
name,
description,
&auth_data.user_id,
)
.execute(&state.pool)
.await
Expand Down Expand Up @@ -4191,9 +4192,10 @@ async fn query(

// Update entry
sqlx::query!(
"UPDATE shop_item_benefits SET name = $1, description = $2 WHERE id = $3",
"UPDATE shop_item_benefits SET name = $1, description = $2, last_updated = NOW(), updated_by = $3 WHERE id = $4",
name,
description,
&auth_data.user_id,
id,
)
.execute(&state.pool)
Expand Down

0 comments on commit e2b753d

Please sign in to comment.