Resolve "addButton (for demo)"
This commit is contained in:
parent
54b2b41ed2
commit
60712e8397
7 changed files with 210 additions and 25 deletions
|
|
@ -95,6 +95,17 @@ export const executeQuery = async (query: string) => {
|
|||
console.error("Query could not be executed!");
|
||||
};
|
||||
|
||||
export const deleteExpenses = async () => {
|
||||
try {
|
||||
await db.transactionAsync(async (tx: SQLite.SQLTransactionAsync) => {
|
||||
await tx.executeSqlAsync("DELETE FROM expense;");
|
||||
});
|
||||
} catch(error) {
|
||||
console.log("Error deleting expense: ", error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
export const deleteDatabase = () => {
|
||||
closeDatabase().then(() => {
|
||||
try {
|
||||
|
|
|
|||
Reference in a new issue