From 8df26ff1e01f707517e304590761f688618abca6 Mon Sep 17 00:00:00 2001 From: anhnh12 Date: Fri, 22 Dec 2023 16:19:56 +0700 Subject: [PATCH] fix: update noti settings --- docs/docs.go | 10 ---------- docs/swagger.json | 10 ---------- docs/swagger.yaml | 7 ------- pkg/entities/setting.go | 2 +- pkg/request/setting.go | 2 +- 5 files changed, 2 insertions(+), 29 deletions(-) diff --git a/docs/docs.go b/docs/docs.go index c5b4e2a0..9e417f5c 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -8003,12 +8003,6 @@ const docTemplate = `{ "default_receiver_platform": { "type": "string" }, - "default_token": { - "$ref": "#/definitions/model.PayToken" - }, - "default_token_id": { - "type": "string" - }, "prioritized_token": { "type": "array", "items": { @@ -8949,7 +8943,6 @@ const docTemplate = `{ "default_message_settings", "default_money_source", "default_receiver_platform", - "default_token", "token_priorities", "tx_limit_enable", "tx_limit_settings" @@ -8970,9 +8963,6 @@ const docTemplate = `{ "default_receiver_platform": { "type": "string" }, - "default_token": { - "type": "string" - }, "token_priorities": { "type": "array", "items": { diff --git a/docs/swagger.json b/docs/swagger.json index a251e604..98313a78 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -7995,12 +7995,6 @@ "default_receiver_platform": { "type": "string" }, - "default_token": { - "$ref": "#/definitions/model.PayToken" - }, - "default_token_id": { - "type": "string" - }, "prioritized_token": { "type": "array", "items": { @@ -8941,7 +8935,6 @@ "default_message_settings", "default_money_source", "default_receiver_platform", - "default_token", "token_priorities", "tx_limit_enable", "tx_limit_settings" @@ -8962,9 +8955,6 @@ "default_receiver_platform": { "type": "string" }, - "default_token": { - "type": "string" - }, "token_priorities": { "type": "array", "items": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 4c22bddb..04282d0f 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -965,10 +965,6 @@ definitions: $ref: '#/definitions/model.MoneySource' default_receiver_platform: type: string - default_token: - $ref: '#/definitions/model.PayToken' - default_token_id: - type: string prioritized_token: items: $ref: '#/definitions/model.PayToken' @@ -1596,8 +1592,6 @@ definitions: $ref: '#/definitions/request.MoneySource' default_receiver_platform: type: string - default_token: - type: string token_priorities: items: type: string @@ -1613,7 +1607,6 @@ definitions: - default_message_settings - default_money_source - default_receiver_platform - - default_token - token_priorities - tx_limit_enable - tx_limit_settings diff --git a/pkg/entities/setting.go b/pkg/entities/setting.go index a7a88eaa..011aaaab 100644 --- a/pkg/entities/setting.go +++ b/pkg/entities/setting.go @@ -269,7 +269,7 @@ func (e *Entity) UpdateUserNotificationSettings(uri request.UserSettingBaseUriRe // update payment setting userNotiSettings := model.UserNotificationSetting{ ProfileId: uri.ProfileId, - Enable: payload.Enable, + Enable: *payload.Enable, Platforms: payload.Platforms, Flags: payload.Flags, NotificationSettings: notificationFlags, diff --git a/pkg/request/setting.go b/pkg/request/setting.go index da8aa353..9cc7ea45 100644 --- a/pkg/request/setting.go +++ b/pkg/request/setting.go @@ -53,7 +53,7 @@ type PrivacySetting struct { } type UpdateNotificationSettingPayloadRequest struct { - Enable bool `json:"enable" binding:"required"` + Enable *bool `json:"enable" binding:"required"` Platforms []string `json:"platforms" binding:"required"` Flags map[string]bool `json:"flags" binding:"required"` }