mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-20 02:10:15 +01:00
refactor: use Constants value for GLOBAL_PROJECT_NAME (enum)
This commit is contained in:
parent
7d303b3581
commit
72dfcb9dc9
5 changed files with 16 additions and 6 deletions
|
|
@ -1,6 +1,9 @@
|
|||
const { model } = require('mongoose');
|
||||
const { Constants } = require('librechat-data-provider');
|
||||
const projectSchema = require('~/models/schema/projectSchema');
|
||||
|
||||
const { GLOBAL_PROJECT_NAME } = Constants;
|
||||
|
||||
const Project = model('Project', projectSchema);
|
||||
|
||||
/**
|
||||
|
|
@ -33,7 +36,7 @@ const getProjectByName = async function (projectName, fieldsToSelect = null) {
|
|||
const update = { $setOnInsert: { name: projectName } };
|
||||
const options = {
|
||||
new: true,
|
||||
upsert: projectName === 'instance',
|
||||
upsert: projectName === GLOBAL_PROJECT_NAME,
|
||||
lean: true,
|
||||
select: fieldsToSelect,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue