Compare commits

...

3 commits

4 changed files with 9 additions and 2 deletions

View file

@ -0,0 +1,7 @@
SELECT
cache_name,
uploaded,
downloads,
max_downloads
FROM records
WHERE cache_name = ?;

View file

@ -1,3 +1,3 @@
UPDATE record
SET downloads = downloads + 1
WHERE cache_name = ?
WHERE cache_name = ?;

View file

@ -86,7 +86,7 @@ async fn upload_to_zip(
let mut conn = state.pool.acquire().await.unwrap();
let cache_name = cache_name.clone();
sqlx::query_file!("queries/records/new.sql", cache_name, 5)
sqlx::query_file!("queries/records/new_record.sql", cache_name, 5)
.execute(&mut *conn)
.await
.map_err(|err| (StatusCode::INTERNAL_SERVER_ERROR, err.to_string()))?;