Allow to unset background image
This commit is contained in:
@@ -917,7 +917,7 @@ async function getBackgroundImage(id) {
|
||||
|
||||
async function setBackgroundImage(id, backgroundImage) {
|
||||
assert.strictEqual(typeof id, 'string');
|
||||
assert(Buffer.isBuffer(backgroundImage));
|
||||
assert(Buffer.isBuffer(backgroundImage) || backgroundImage === null);
|
||||
|
||||
const result = await database.query('UPDATE users SET backgroundImage=? WHERE id = ?', [ backgroundImage, id ]);
|
||||
if (result.length === 0) throw new BoxError(BoxError.NOT_FOUND, 'User not found');
|
||||
|
||||
Reference in New Issue
Block a user