mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-22 19:30:15 +01:00
refactor: update getAppConfig calls in Conversation and Message models to include user role for temporary chat expiration
This commit is contained in:
parent
57513f7ac9
commit
8f89fdc802
2 changed files with 6 additions and 2 deletions
|
|
@ -102,7 +102,9 @@ module.exports = {
|
||||||
|
|
||||||
if (req?.body?.isTemporary) {
|
if (req?.body?.isTemporary) {
|
||||||
try {
|
try {
|
||||||
const appConfig = await getAppConfig();
|
const appConfig = await getAppConfig({
|
||||||
|
role: req.user.role,
|
||||||
|
});
|
||||||
update.expiredAt = createTempChatExpirationDate(appConfig?.interfaceConfig);
|
update.expiredAt = createTempChatExpirationDate(appConfig?.interfaceConfig);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
logger.error('Error creating temporary chat expiration date:', err);
|
logger.error('Error creating temporary chat expiration date:', err);
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,9 @@ async function saveMessage(req, params, metadata) {
|
||||||
|
|
||||||
if (req?.body?.isTemporary) {
|
if (req?.body?.isTemporary) {
|
||||||
try {
|
try {
|
||||||
const appConfig = await getAppConfig();
|
const appConfig = await getAppConfig({
|
||||||
|
role: req.user.role,
|
||||||
|
});
|
||||||
update.expiredAt = createTempChatExpirationDate(appConfig?.interfaceConfig);
|
update.expiredAt = createTempChatExpirationDate(appConfig?.interfaceConfig);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
logger.error('Error creating temporary chat expiration date:', err);
|
logger.error('Error creating temporary chat expiration date:', err);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue