File size: 386 Bytes
f0743f4
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
import pluginAuthSchema from '~/schema/pluginAuth';
import type { IPluginAuth } from '~/types/pluginAuth';

/**
 * Creates or returns the PluginAuth model using the provided mongoose instance and schema
 */
export function createPluginAuthModel(mongoose: typeof import('mongoose')) {
  return mongoose.models.PluginAuth || mongoose.model<IPluginAuth>('PluginAuth', pluginAuthSchema);
}