Change SQL query
This commit is contained in:
parent
f1994b2f5d
commit
21985f8aa6
|
@ -6,7 +6,7 @@ export async function getBook(id: number): Promise<DetailedBook> {
|
||||||
const database = new sqlite3.Database(DATABASE_PATH, sqlite3.OPEN_READONLY);
|
const database = new sqlite3.Database(DATABASE_PATH, sqlite3.OPEN_READONLY);
|
||||||
|
|
||||||
const sql =
|
const sql =
|
||||||
"SELECT isbn, lccn, title, subtitle, authors, edition, publisher, publish_year, publish_month, publish_location, pages, pagination, weight, last_updated, deleted FROM books WHERE id = ? AND deleted = 0";
|
"SELECT isbn, lccn, title, subtitle, authors, edition, publisher, publish_year, publish_month, publish_location, pages, pagination, weight, last_updated FROM books WHERE id = ? AND deleted = 0";
|
||||||
|
|
||||||
const book: Promise<DetailedBook> = new Promise((resolve, reject) => {
|
const book: Promise<DetailedBook> = new Promise((resolve, reject) => {
|
||||||
database.get(sql, [id], (err: Error | null, book: DetailedBook) => {
|
database.get(sql, [id], (err: Error | null, book: DetailedBook) => {
|
||||||
|
|
Loading…
Reference in New Issue