Updated + first rough implementation

This commit is contained in:
lukeIam committed 2023-09-13 16:35:39 +00:00
1 parent f0f03efe17
commit 405c954b65
5 files changed
+104 -25

No files matched your search

+19
View File
@@ -194,6 +194,25 @@ class User extends Model {
return this.getOldUser(user)
}
/**
* Get user by email case insensitive
* @param {string} username
* @returns {Promise<oldUser|null>} returns null if not found
*/
static async getUserByEmail(email) {
if (!email) return null
const user = await this.findOne({
where: {
email: {
[Op.like]: email
}
},
include: this.sequelize.models.mediaProgress
})
if (!user) return null
return this.getOldUser(user)
}
/**
* Get user by id
* @param {string} userId