Move usermethods and models to data-schema

This commit is contained in:
Cha 2025-05-29 16:37:31 +08:00 committed by Danny Avila
parent 4808c5be48
commit 4049b5572c
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956
93 changed files with 2396 additions and 1267 deletions

View file

@ -2,8 +2,8 @@ const path = require('path');
const { v5: uuidv5 } = require('uuid');
require('module-alias')({ base: path.resolve(__dirname, '..', 'api') });
const { askQuestion, askMultiLineQuestion, silentExit } = require('./helpers');
const { Banner } = require('~/models/Banner');
const connect = require('./connect');
const db = require('~/lib/db/connectDb');
(async () => {
await connect();
@ -87,6 +87,7 @@ const connect = require('./connect');
let result;
try {
const { Banner } = db.models;
// There is always only one Banner record in the DB.
// If a Banner exists in the DB, it will be updated.
// If it doesn't exist, a new one will be added.