Skip to content

Commit

Permalink
Fix database empty check after creating user
Browse files Browse the repository at this point in the history
  • Loading branch information
gf-rog committed Mar 22, 2024
1 parent 6c2c3e8 commit b76efae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/src/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export async function isDatabaseEmpty() {
}

export async function importInitialData() {
const isEmpty = await isDatabaseEmpty();

const testUser = await registerUser({
first_name: "John",
last_name: "Smith",
Expand All @@ -35,7 +37,6 @@ export async function importInitialData() {
console.log("Test user created: ", testUser)
}

const isEmpty = await isDatabaseEmpty();
if (!isEmpty) {
return "Database is not empty";
}
Expand Down

0 comments on commit b76efae

Please sign in to comment.