This commit is contained in:
Marc
2025-03-24 18:07:27 +00:00
committed by GitHub
8 changed files with 212 additions and 76 deletions

View File

@@ -48,6 +48,17 @@ class User extends BeanModel {
}, jwtSecret);
}
/**
* @param {number} userID ID of user to update
* @param {string} newUsername Users new username
* @returns {Promise<void>}
*/
static async updateUsername(userID, newUsername) {
await R.exec("UPDATE `user` SET username = ? WHERE id = ? ", [
newUsername,
userID
]);
}
}
module.exports = User;