Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix notification setting can't update without slack token #1849

Merged
merged 3 commits into from Apr 6, 2020

Conversation

fezzlk
Copy link
Contributor

@fezzlk fezzlk commented Apr 5, 2020

No description provided.

Copy link
Contributor Author

@fezzlk fezzlk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

管理画面の他の箇所に似たようなバグはなさそうですが、他のadmin container も同様にすべきでしょうか。
もしくは、ここを修正するのではなく、サーバー側のバリデーションのisString()を撤去するべきでしょうか
https://github.com/weseek/growi/blob/master/src/server/routes/apiv3/notification-setting.js#L19

isNotificationForOwnerPageEnabled: notificationParams.isNotificationForOwnerPageEnabled,
isNotificationForGroupPageEnabled: notificationParams.isNotificationForGroupPageEnabled,
globalNotifications: notificationParams.globalNotifications,
webhookUrl: notificationParams.webhookUrl || '',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

バグ解消のために必要なのは webhookUrlslackToken だけですが念のため他も変更しました。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apiV3/security-setting.js のように、

    body('restrictGuestMode').if(value => value != null).isString().isIn([
      'Deny', 'Readonly',
    ])

サーバー側の validation で 存在チェックを挟んでから型チェックをするのが良いと思います

@yuki-takei yuki-takei merged commit f9ff67d into master Apr 6, 2020
@yuki-takei yuki-takei deleted the fix/slack-token-default-value-loaded-from-DB branch April 6, 2020 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants