mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-15 04:13:47 +00:00
refactor: create project
This commit is contained in:
committed by
Carlos Valente
parent
ad69c0ff80
commit
21454947e0
@@ -88,10 +88,10 @@ const init = async () => {
|
||||
/**
|
||||
* Allows to switch the database to a new file
|
||||
*/
|
||||
export const switchDb = async (newFileName: string) => {
|
||||
const { db: newDb, data: newData } = await loadDb(resolveDbDirectory, newFileName);
|
||||
export const switchDb = async (filePath: string, data: DatabaseModel) => {
|
||||
const newDb = await JSONFilePreset<DatabaseModel>(filePath, data);
|
||||
db = newDb;
|
||||
data = newData;
|
||||
data = newDb.data;
|
||||
};
|
||||
|
||||
init();
|
||||
|
||||
Reference in New Issue
Block a user