Skip to content

Commit

Permalink
Merge pull request #5 from jay16213/bugfix/issue4
Browse files Browse the repository at this point in the history
fix snack name duplicate not return issue
  • Loading branch information
jay16213 authored Nov 7, 2020
2 parents bb95094 + 34125fa commit 619d094
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mongodb-backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
rollingDays=7
dumpFilename="mongodb"
dumpTmpDir="/tmp/mongo-dump-tmp"
backupPath="./snacksdb-backup"
backupPath="/home/jay/snacksdb-backup"
username=""
password=""
hostname="127.0.0.1:27018"
Expand Down
2 changes: 1 addition & 1 deletion slack/bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ module.exports = {
blockOffset++
viewPayload.blocks.splice(blockOffset, 0, {type: 'actions', elements: []})
}
console.log(`insert ${numOfSnacks} to block ${blockOffset}`)
console.debug(`insert ${numOfSnacks} to block ${blockOffset}`)
viewPayload.blocks[blockOffset].elements.push({
type: 'button',
action_id: `buy:${snack.name}`,
Expand Down
1 change: 1 addition & 0 deletions slack/interactive.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ let sellSnacks = async (slackUser, snackName, amount, totalPrice) => {
let snackExists = await Snack.exists({name: snackName})
if (snackExists) {
await slackBot.sendDirectMessage(slackUser.id, `${snackName} has existed at store, you can't not sell the same thing until it sold out.`)
return
}

let price = calculatePrice(amount, totalPrice)
Expand Down

0 comments on commit 619d094

Please sign in to comment.