Skip to content

Commit

Permalink
Don't Promise.all in getClubInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwofford committed Jan 8, 2020
1 parent 87ebf92 commit 64cc7b7
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,24 +191,15 @@ export const getClubInfo = async search => {
)
}
if (results.club) {
await Promise.all([
async () => {
results.rawHistory = await airGet(
'History',
'Club',
results.club.fields.ID
)
},
async () => {
if (results.club.fields['Privacy Card']) {
results.card = await airFind(
'Privacy Cards',
'Club',
results.club.fields.ID
)
}
},
])
results.rawHistory = await airGet('History', 'Club', results.club.fields.ID)

if (results.club.fields['Privacy Card']) {
results.card = await airFind(
'Privacy Cards',
'Club',
results.club.fields.ID
)
}
}
if (results.rawHistory) {
results.history = {
Expand Down

0 comments on commit 64cc7b7

Please sign in to comment.