mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-04 01:28:51 +01:00
refactor(db): replace connectDb import paths and introduce new connect module
- Updated import paths for connectDb across various files to use the new centralized connect module. - Removed the old connectDb file to streamline the database connection logic. - Ensured all tests and models reference the new connection method for consistency.
This commit is contained in:
parent
7cf3f98475
commit
eb368fcb70
17 changed files with 36 additions and 42 deletions
|
|
@ -1,6 +1,6 @@
|
|||
const mongoose = require('mongoose');
|
||||
const { v4: uuidv4 } = require('uuid');
|
||||
const db = require('~/lib/db/connectDb');
|
||||
const db = require('db/connect');
|
||||
|
||||
jest.mock('mongoose');
|
||||
|
||||
|
|
@ -35,7 +35,7 @@ const mockModels = {
|
|||
},
|
||||
};
|
||||
|
||||
jest.mock('~/lib/db/connectDb', () => {
|
||||
jest.mock('~/db/connect', () => {
|
||||
return {
|
||||
get models() {
|
||||
return mockModels;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
const mongoose = require('mongoose');
|
||||
const { createModels, createMethods } = require('@librechat/data-schemas');
|
||||
createModels(mongoose);
|
||||
const { createMethods } = require('@librechat/data-schemas');
|
||||
const methods = createMethods(mongoose);
|
||||
const { comparePassword } = require('./userMethods');
|
||||
const {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
const { logger } = require('~/config');
|
||||
const db = require('~/lib/db/connectDb');
|
||||
const db = require('db/connect');
|
||||
const { createTransaction, createStructuredTransaction } = require('./Transaction');
|
||||
/**
|
||||
* Creates up to two transactions to record the spending of tokens.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue