cleanup # 2
This commit is contained in:
parent
d5c2c1a78d
commit
26c7ac9341
4 changed files with 2 additions and 6 deletions
|
@ -11,7 +11,7 @@ pub async fn get_books(
|
|||
let search_term = query.get("search").map(|s| s.as_str()).unwrap_or("");
|
||||
let sort_by = query.get("sort").map(|s| s.as_str()).unwrap_or("default");
|
||||
|
||||
let mut base_query = "SELECT id, tytul, autor, cena, COALESCE('/images/' || obraz_url, '/images/placeholder.jpg') as obraz_url, COALESCE(opis, 'Brak opisu') as opis FROM ksiazki".to_string();
|
||||
let base_query = "SELECT id, tytul, autor, cena, COALESCE('/images/' || obraz_url, '/images/placeholder.jpg') as obraz_url, COALESCE(opis, 'Brak opisu') as opis FROM ksiazki".to_string();
|
||||
|
||||
let where_clause = if !search_term.is_empty() {
|
||||
" WHERE LOWER(tytul) LIKE LOWER($1) OR LOWER(autor) LIKE LOWER($1)"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use actix_web::{get, post, delete, web, HttpResponse, HttpRequest, Responder};
|
||||
use actix_web::{get, post, delete, web, HttpResponse, HttpRequest};
|
||||
use crate::models::{CartItem, CartItemResponse, CheckoutRequest};
|
||||
use crate::error::AppError;
|
||||
use sqlx::PgPool;
|
||||
|
|
|
@ -12,7 +12,6 @@ use dotenv::dotenv;
|
|||
use env_logger::Builder;
|
||||
use sqlx::postgres::PgPoolOptions;
|
||||
use std::env;
|
||||
use log;
|
||||
|
||||
#[actix_web::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
use actix_web::{get, web, HttpResponse, HttpRequest};
|
||||
use serde::Serialize;
|
||||
use sqlx::PgPool;
|
||||
use crate::error::AppError;
|
||||
use bigdecimal::BigDecimal;
|
||||
use chrono::NaiveDateTime;
|
||||
use crate::auth::validate_token;
|
||||
use crate::models::{OrderItem, OrderWithItems};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue