File size: 333 Bytes
f0743f4
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
import shareSchema, { ISharedLink } from '~/schema/share';

/**
 * Creates or returns the SharedLink model using the provided mongoose instance and schema
 */
export function createSharedLinkModel(mongoose: typeof import('mongoose')) {
  return mongoose.models.SharedLink || mongoose.model<ISharedLink>('SharedLink', shareSchema);
}