ryuichi-e 5 лет назад
Родитель
Сommit
2e5b7e410b
1 измененных файлов с 8 добавлено и 15 удалено
  1. 8 15
      src/migrations/20200901034313-update-mail-transmission.js

+ 8 - 15
src/migrations/20200901034313-update-mail-transmission.js

@@ -21,21 +21,14 @@ module.exports = {
     if (sesExist == null) {
       return logger.info('Document does not exist, value of transmission method will be set smtp automatically.');
     }
-    if (sesExist.value != null) {
-      await Config.create({
-        ns: 'crowi',
-        key: 'mail:transmissionMethod',
-        value: 'ses',
-      });
-    }
-    else {
-      await Config.create({
-        ns: 'crowi',
-        key: 'mail:transmissionMethod',
-        value: 'smtp',
-      });
-    }
-
+    const value = (
+      sesExist.value != null ? 'ses' : 'smtp'
+    );
+    await Config.create({
+      ns: 'crowi',
+      key: 'mail:transmissionMethod',
+      value,
+    });
     logger.info('Migration has successfully applied');
 
   },