-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from cmtanko/APP-010-backup-restore-db
[App-010] Add ability to backup restore db
- Loading branch information
Showing
24 changed files
with
1,232 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
React Native Starter Kit | ||
A personal expense manager app to manage all your income and expenses, It help budget your finance and get easy reports. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
React Native Starter Kit | ||
A personal expense manager app to manage all your income and expenses |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
React Native Starter Kit | ||
Personal Expense Manager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import {insertBackup, fetchBackup, resetData} from '../../helpers/db'; | ||
|
||
export const getBackup = () => { | ||
return async (dispatch) => { | ||
try { | ||
const dbResult = await fetchBackup(); | ||
dispatch({ | ||
type: 'backup_fetch_success', | ||
payload: dbResult, | ||
}); | ||
} catch (error) { | ||
throw error; | ||
} | ||
}; | ||
}; | ||
|
||
export const addBackup = ({title, date, callback}) => { | ||
return async (dispatch) => { | ||
try { | ||
const dbResult = await insertBackup(title, date); | ||
const backupData = { | ||
id: dbResult.insertId.toString(), | ||
title: title, | ||
date: date, | ||
}; | ||
dispatch({type: 'backup_created_success', payload: backupData}); | ||
callback(); | ||
} catch (error) { | ||
throw error; | ||
} | ||
}; | ||
}; | ||
|
||
export const resetDatabase = (accounts, categories, records, callback) => { | ||
return async (dispatch) => { | ||
try { | ||
const dbResult = await resetData(accounts, categories, records); | ||
dispatch({type: 'database_reset_success', payload: {}}); | ||
callback(); | ||
} catch (error) { | ||
throw error; | ||
} | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export * from './Category'; | ||
export * from './Account'; | ||
export * from './Backup'; | ||
export * from './Record'; | ||
export * from './Report'; | ||
export * from './Account'; | ||
export * from './Category'; |
Oops, something went wrong.