()
| 86 | }; |
| 87 | |
| 88 | export const initializeDb = async () => { |
| 89 | const database = await loadDb(); |
| 90 | Object.entries(db).forEach(([key, model]) => { |
| 91 | const dataEntres = database[key]; |
| 92 | if (dataEntres) { |
| 93 | dataEntres?.forEach((entry: Record<string, any>) => { |
| 94 | model.create(entry); |
| 95 | }); |
| 96 | } |
| 97 | }); |
| 98 | }; |
| 99 | |
| 100 | export const resetDb = () => { |
| 101 | window.localStorage.clear(); |
no test coverage detected