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
|
// disable freebies if it hasn't been set yet
|
||||||
await models.user.update({
|
try {
|
||||||
where: { id: me.id, disableFreebies: null },
|
await models.user.update({
|
||||||
data: { disableFreebies: true }
|
where: { id: me.id, disableFreebies: null },
|
||||||
})
|
data: { disableFreebies: true }
|
||||||
|
})
|
||||||
|
} catch (err) {
|
||||||
|
// ignore 'record not found' errors
|
||||||
|
if (err.code !== 'P2025') {
|
||||||
|
throw err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user