Skip to content

Commit

Permalink
fix(procedures): fix checking for procedures array to run configureSetup
Browse files Browse the repository at this point in the history
  • Loading branch information
leomp12 committed Jul 31, 2019
1 parent 4fdf244 commit 1371cdc
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions app/bin/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@ ecomAuth.then(appSdk => {
// configure setup for stores
// list of procedures to save
const procedures = require('./../lib/store-api/procedures')
if (procedures && procedures.triggers && procedures.triggers.length) {
appSdk.configureSetup(procedures, (err, { storeId }) => {
if (!err) {
logger.log('--> Setup store #' + storeId)
} else if (!err.appAuthRemoved) {
logger.error(err)
}
})
if (procedures && procedures.length) {
const { triggers } = procedures[0]
if (triggers && triggers.length) {
appSdk.configureSetup(procedures, (err, { storeId }) => {
if (!err) {
logger.log('--> Setup store #' + storeId)
} else if (!err.appAuthRemoved) {
logger.error(err)
}
})
}
}
})

Expand Down

0 comments on commit 1371cdc

Please sign in to comment.