Przeglądaj źródła

add param in request body

itizawa 6 lat temu
rodzic
commit
8ff022eb16

+ 7 - 1
src/client/js/components/Admin/Notification/ManageGlobalNotification.jsx

@@ -77,7 +77,13 @@ class ManageGlobalNotification extends React.Component {
   async submitHandler() {
 
     try {
-      await this.props.appContainer.apiv3.post('/notification-setting/global-notification');
+      await this.props.appContainer.apiv3.post('/notification-setting/global-notification', {
+        triggerPath: this.state.triggerPath,
+        notifyToType: this.state.notifyToType,
+        emailToSend: this.state.emailToSend,
+        slackChannelToSend: this.state.slackChannelToSend,
+        triggerEvents: this.state.triggerEvents,
+      });
     }
     catch (err) {
       toastError(err);

+ 0 - 5
src/server/routes/apiv3/notification-setting.js

@@ -193,11 +193,6 @@ module.exports = (crowi) => {
   // TODO swagger
   router.post('/global-notification', loginRequiredStrictly, adminRequired, csrf, async(req, res) => {
 
-    const form = req.body;
-
-    console.log(form);
-    let setting;
-
     // switch (form.notifyToType) {
     //   case GlobalNotificationSetting.TYPE.MAIL:
     //     setting = new GlobalNotificationMailSetting(crowi);