OfferSchema.pre('save', async function onSave(next) { if (this.isNew) { await OfferLocation.createByOffer(this); } next(); });
OfferSchema.pre('save', async function onSave(next) { if (this.isNew) { await OfferLocation.createByOffer(this); } next(); });