Ignore no rows found in disableFreebies (#1326)
This commit is contained in:
parent
82788b35bf
commit
382f16643d
@ -628,10 +628,17 @@ export default {
|
||||
}
|
||||
|
||||
// disable freebies if it hasn't been set yet
|
||||
await models.user.update({
|
||||
where: { id: me.id, disableFreebies: null },
|
||||
data: { disableFreebies: true }
|
||||
})
|
||||
try {
|
||||
await models.user.update({
|
||||
where: { id: me.id, disableFreebies: null },
|
||||
data: { disableFreebies: true }
|
||||
})
|
||||
} catch (err) {
|
||||
// ignore 'record not found' errors
|
||||
if (err.code !== 'P2025') {
|
||||
throw err
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user