Skip to content
Snippets Groups Projects
Commit bebf1544 authored by Sebastian Mihalache's avatar Sebastian Mihalache
Browse files

fix(user-helper): throw error if no EiC is found

parent 54de74f5
No related branches found
No related tags found
1 merge request!34Sprint 17 features
......@@ -45,7 +45,12 @@ class User {
const { UserModel } = this
const users = await UserModel.all()
return users.filter(user => user.editorInChief)
const eics = users.filter(user => user.editorInChief)
if (eics.length === 0) {
throw new Error('No Editor in Chief has been found')
}
return eics
}
async updateUserTeams({ userId, teamId }) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment