Explorar o código

add isEnableQuestionnaire attr and a method

Taichi Masuyama %!s(int64=3) %!d(string=hai) anos
pai
achega
fe96f2a640
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      packages/app/src/server/models/user.js

+ 6 - 0
packages/app/src/server/models/user.js

@@ -69,6 +69,7 @@ module.exports = function(crowi) {
     lastLoginAt: { type: Date },
     admin: { type: Boolean, default: 0, index: true },
     isInvitationEmailSended: { type: Boolean, default: false },
+    isEnableQuestionnaire: { type: Boolean, default: true },
   }, {
     timestamps: true,
     toObject: {
@@ -730,6 +731,11 @@ module.exports = function(crowi) {
     return { users, totalCount };
   };
 
+  userSchema.methods.updateIsEnableQuestionnaire = async function(value) {
+    this.isEnableQuestionnaire = value;
+    return this.save();
+  };
+
   class UserUpperLimitException {
 
     constructor() {