fix error handling and displaying on membership PUT and DELETE; don't allow to change your own role; require at least one admin

This commit is contained in:
mntmn
2020-04-09 14:55:18 +02:00
parent c05afaba8a
commit 16ffecdb16
4 changed files with 57 additions and 21 deletions

View File

@@ -91,7 +91,7 @@ module.exports = {
user_id: Sequelize.STRING,
role: Sequelize.STRING,
code: Sequelize.STRING,
state: {type: Sequelize.STRING, defaultValue: "pending"},
state: {type: Sequelize.STRING, defaultValue: "pending"}, // valid: "pending", "active"
email_invited: Sequelize.STRING,
created_at: {type: Sequelize.DATE, defaultValue: Sequelize.NOW},
updated_at: {type: Sequelize.DATE, defaultValue: Sequelize.NOW}