mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-29 05:36:13 +01:00
10 lines
331 B
TypeScript
10 lines
331 B
TypeScript
|
|
import fileSchema from '~/schema/file';
|
||
|
|
import type { IMongoFile } from '~/types';
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Creates or returns the File model using the provided mongoose instance and schema
|
||
|
|
*/
|
||
|
|
export function createFileModel(mongoose: typeof import('mongoose')) {
|
||
|
|
return mongoose.models.File || mongoose.model<IMongoFile>('File', fileSchema);
|
||
|
|
}
|