Skip to content

Commit

Permalink
return channel after update
Browse files Browse the repository at this point in the history
  • Loading branch information
lluisd committed May 14, 2024
1 parent 17bcec2 commit f11db59
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion handlers/tempsDeFlors.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class TempsDeFlors {

async setDeactivate (target, bot) {
const channelBeforeUpdate = await TwitchService.setActiveSpot(0)
if (channelBeforeUpdate && channelBeforeUpdate.activeSpot !== 0) {
if (channelBeforeUpdate?.activeSpot && channelBeforeUpdate.activeSpot !== 0) {
bot.say(target, `Punto ${channelBeforeUpdate.activeSpot} desactivado.`)
}
}
Expand Down
2 changes: 1 addition & 1 deletion helpers/dbmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function getChannel (name) {
}

function updateChannel (name, update) {
return Channel.updateOne({name: name}, {...update })
return Channel.findOneAndUpdate({name: name}, {...update })
}

async function getMuncipioStartsWith (name) {
Expand Down

0 comments on commit f11db59

Please sign in to comment.