Commit 7a13f9c9 by 1808837298@qq.com

fix: Ensure correct quota warning threshold type conversion

parent 1c20d16c
...@@ -913,11 +913,11 @@ func TopUp(c *gin.Context) { ...@@ -913,11 +913,11 @@ func TopUp(c *gin.Context) {
} }
type UpdateUserSettingRequest struct { type UpdateUserSettingRequest struct {
QuotaWarningType string `json:"notify_type"` QuotaWarningType string `json:"notify_type"`
QuotaWarningThreshold int `json:"quota_warning_threshold"` QuotaWarningThreshold float64 `json:"quota_warning_threshold"`
WebhookUrl string `json:"webhook_url,omitempty"` WebhookUrl string `json:"webhook_url,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"` WebhookSecret string `json:"webhook_secret,omitempty"`
NotificationEmail string `json:"notification_email,omitempty"` NotificationEmail string `json:"notification_email,omitempty"`
} }
func UpdateUserSetting(c *gin.Context) { func UpdateUserSetting(c *gin.Context) {
......
...@@ -330,7 +330,7 @@ const PersonalSetting = () => { ...@@ -330,7 +330,7 @@ const PersonalSetting = () => {
try { try {
const res = await API.put('/api/user/setting', { const res = await API.put('/api/user/setting', {
notify_type: notificationSettings.warningType, notify_type: notificationSettings.warningType,
quota_warning_threshold: notificationSettings.warningThreshold, quota_warning_threshold: parseFloat(notificationSettings.warningThreshold),
webhook_url: notificationSettings.webhookUrl, webhook_url: notificationSettings.webhookUrl,
webhook_secret: notificationSettings.webhookSecret, webhook_secret: notificationSettings.webhookSecret,
notification_email: notificationSettings.notificationEmail notification_email: notificationSettings.notificationEmail
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment