Skip to content

Commit

Permalink
improve data seed performance
Browse files Browse the repository at this point in the history
  • Loading branch information
dnikolov123 authored and groupsky committed Oct 26, 2018
1 parent f65c643 commit 6d28796
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions __tests__/classes/MembershipExpirationProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ const subDays = require('date-fns/sub_days')
const fromDate = new Date()

const generateMemberWithEmail = async (memberOpts = {}) => {
const member = await ah.api.models.member.create(generateMember({
...memberOpts
}))
if (!member.email) {
await member.update({ email: `member.${member.id}@bspb.org` })
const generatedMember = generateMember({ ...memberOpts })
if (!generatedMember.email) {
generatedMember.email = `member.${generatedMember.cardId}@bspb.org`
}
const member = await ah.api.models.member.create(generatedMember)
return member
}
const generateMemberAndPayment = async ({ memberOpts = {}, paymentOps = {} }) => {
Expand Down

0 comments on commit 6d28796

Please sign in to comment.