refactor(data-schemas): update model and method creation for improved modularity

- Refactored model creation functions to enhance clarity and consistency across the data-schemas.
- Introduced createModels and createMethods functions to streamline the instantiation of Mongoose models and methods.
- Updated test-role.js to utilize the new createModels and createMethods for better organization.
This commit is contained in:
Danny Avila 2025-05-30 12:20:01 -04:00
parent 728d19e361
commit 76e070048c
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956
15 changed files with 107 additions and 117 deletions

View file

@ -1,9 +1,9 @@
require('dotenv').config({ path: '../.env' });
const mongoose = require('mongoose');
const connect = require('../config/connect');
const { createRoleMethods, createRoleModel } = require('@librechat/data-schemas');
createRoleModel(mongoose);
const { listRoles } = createRoleMethods(mongoose);
const { createModels, createMethods } = require('@librechat/data-schemas');
createModels(mongoose);
const { listRoles } = createMethods(mongoose);
(async () => {
await connect();