Skip to content

Commit

Permalink
chore: log for debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Ray-D-Song committed Oct 23, 2024
1 parent 7c7f719 commit 70ed441
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 381 deletions.
379 changes: 0 additions & 379 deletions packages/server/package-lock.json

This file was deleted.

5 changes: 3 additions & 2 deletions packages/server/src/model/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ async function verifyAdminToken(DB: D1Database, token: string): Promise<'new' |
}
const exist = await checkAdminExist(DB)
if (!exist) {
setAdminToken(DB, token)
return 'new'
const success = await setAdminToken(DB, token)
return success ? 'new' : 'reject'
}
return 'reject'
}
Expand All @@ -22,6 +22,7 @@ async function setAdminToken(DB: D1Database, token: string): Promise<boolean> {
throw new Error('Admin token already exists')
}
const result = await DB.prepare(`INSERT INTO stores (key, value) VALUES ('ADMIN_TOKEN', ?)`).bind(token).run()
console.log(result)
return result.success
}

Expand Down

0 comments on commit 70ed441

Please sign in to comment.