Open hendrysadrak opened 1 year ago
https://github.com/SoftwareBrothers/adminjs-mongoose/blob/b35f89f38494960f9cfbb472efa7c26d4dc618d6/src/property.ts#L72-L80
This part requires another update because the ref in mongoose can be defined as string | Model<any> | ((this: any, doc: any) => string | Model<any>);
ref
string | Model<any> | ((this: any, doc: any) => string | Model<any>);
Right now this logic correctly handles ref: string | Model but not the ref: () => string | Model part
ref: string | Model
ref: () => string | Model
Line 77 should be updated to
if (typeof ref === 'function') return ref.modelName || ref().modelName
Lmk what you think
https://github.com/SoftwareBrothers/adminjs-mongoose/blob/b35f89f38494960f9cfbb472efa7c26d4dc618d6/src/property.ts#L72-L80
This part requires another update because the
ref
in mongoose can be defined asstring | Model<any> | ((this: any, doc: any) => string | Model<any>);
Right now this logic correctly handles
ref: string | Model
but not theref: () => string | Model
partLine 77 should be updated to
Lmk what you think