Skip to content

fix(#653): call adminConfirmationService.initTable() on startup#814

Merged
Haroldwonder merged 2 commits into
Haroldwonder:mainfrom
devSoniia:fix/653-admin-confirmation-init
Jun 7, 2026
Merged

fix(#653): call adminConfirmationService.initTable() on startup#814
Haroldwonder merged 2 commits into
Haroldwonder:mainfrom
devSoniia:fix/653-admin-confirmation-init

Conversation

@devSoniia

Copy link
Copy Markdown
Contributor

Summary

Resolves #653

AdminConfirmationService in backend/src/admin-confirmation.ts exposes an initTable() method that creates the admin_confirmations table, but it was never called during application startup. Any call to initiate() or confirm() before the table existed would throw a 'table does not exist' error.

Changes

  • Created backend/src/admin-confirmation.ts with AdminConfirmationService (initTable, initiate, confirm, getPending) and a singleton factory
  • Updated backend/src/index.ts to call adminConfirmationService.initTable() during startup alongside other DB initialization steps

Testing

The initTable() method uses CREATE TABLE IF NOT EXISTS, so it is safe to call on every startup.

…tartup

The admin_confirmations table was never created at startup, causing
'table does not exist' errors on the first call to initiate or confirm.

- Created backend/src/admin-confirmation.ts with AdminConfirmationService
  and its initTable() method
- Updated backend/src/index.ts to call initTable() during application
  startup alongside other database initialization steps

Closes Haroldwonder#653
@vercel

vercel Bot commented Jun 4, 2026

Copy link
Copy Markdown

@devSoniia is attempting to deploy a commit to the Harold's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Haroldwonder Haroldwonder merged commit aa7cd7b into Haroldwonder:main Jun 7, 2026
4 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

admin-confirmation.ts initTable not called on startup, causing 'table does not exist' errors

2 participants