mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-26 04:06:12 +01:00
10 lines
344 B
TypeScript
10 lines
344 B
TypeScript
|
|
import sessionSchema from '~/schema/session';
|
||
|
|
import type * as t from '~/types';
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Creates or returns the Session model using the provided mongoose instance and schema
|
||
|
|
*/
|
||
|
|
export function createSessionModel(mongoose: typeof import('mongoose')) {
|
||
|
|
return mongoose.models.Session || mongoose.model<t.ISession>('Session', sessionSchema);
|
||
|
|
}
|