|
|
|
@ -7,7 +7,7 @@ export async function getAllBooks() { |
|
|
|
|
|
|
|
|
|
const books = new Promise<SimpleBook[]>((resolve, reject) => { |
|
|
|
|
database.all( |
|
|
|
|
"SELECT title, authors, isbn FROM books", |
|
|
|
|
"SELECT id, title, authors, isbn FROM books WHERE deleted = 0", |
|
|
|
|
(error: Error | null, rows: SimpleBook[]) => { |
|
|
|
|
if (error) { |
|
|
|
|
reject(error); |
|
|
|
@ -23,7 +23,8 @@ export async function getAllBooks() { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export interface SimpleBook { |
|
|
|
|
authors: string; |
|
|
|
|
isbn: string; |
|
|
|
|
title: string; |
|
|
|
|
id: number; |
|
|
|
|
title: string | null; |
|
|
|
|
authors: string | null; |
|
|
|
|
isbn: string | null; |
|
|
|
|
} |
|
|
|
|