|
|
@@ -9,7 +9,7 @@ import mongoose from 'mongoose';
|
|
|
* @return instance of mongoose model
|
|
|
*/
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
|
-export const getModelFromCollectionName = (collectionName: string): Model<any> => {
|
|
|
+export const getModelFromCollectionName = (collectionName: string): Model<any, unknown, unknown, unknown, any> | undefined => {
|
|
|
const models = mongoose.modelNames().map(modelName => mongoose.model(modelName));
|
|
|
|
|
|
const Model = Object.values(models).find((m) => {
|