import { Book } from "../types/Book"; import { getBook } from "./getBook"; export const findBook = ({ uuid, isbn, title, }: Pick, "uuid" | "title" | "isbn">) => { return !!uuid ? getBook({ uuid }) : title ? `SELECT * FROM bookData WHERE title LIKE '%${title.toLowerCase()}%';` : `SELECT * FROM bookData WHERE isbn LIKE '%${isbn}%';`; };