diff --git a/src/graphql/query/checkout/initializeCheckout.graphql b/src/graphql/query/checkout/initializeCheckout.graphql index 21775cc7a1..11183e0815 100644 --- a/src/graphql/query/checkout/initializeCheckout.graphql +++ b/src/graphql/query/checkout/initializeCheckout.graphql @@ -38,11 +38,11 @@ query initializeCheckout($basketId: String) { key value } - ftd_amount: uiConfigSetting(key: "ftd_message_amount") { + ftd_message_amount: uiConfigSetting(key: "ftd_message_amount") { key value } - ftd_date_time: uiConfigSetting(key: "ftd_message_valid_date") { + ftd_message_valid_date: uiConfigSetting(key: "ftd_message_valid_date") { key value } diff --git a/src/graphql/query/thanksPage.graphql b/src/graphql/query/thanksPage.graphql index 1123bee1c4..852a58e370 100644 --- a/src/graphql/query/thanksPage.graphql +++ b/src/graphql/query/thanksPage.graphql @@ -136,7 +136,7 @@ query checkoutReceipt($checkoutId: Int!, $visitorId: String) { key value } - ftd_amount: uiConfigSetting(key: "ftd_message_amount") { + ftd_message_amount: uiConfigSetting(key: "ftd_message_amount") { key value } diff --git a/src/pages/Checkout/CheckoutPage.vue b/src/pages/Checkout/CheckoutPage.vue index 980275214a..bef5a8b2fe 100644 --- a/src/pages/Checkout/CheckoutPage.vue +++ b/src/pages/Checkout/CheckoutPage.vue @@ -282,6 +282,7 @@ import { gql } from '@apollo/client'; import _get from 'lodash/get'; import _filter from 'lodash/filter'; import numeral from 'numeral'; +import { readBoolSetting } from '@/util/settingsUtils'; import { preFetchAll } from '@/util/apolloPreFetch'; import syncDate from '@/util/syncDate'; import { myFTDQuery, formatTransactionData } from '@/util/checkoutUtils'; @@ -494,9 +495,10 @@ export default { this.activeLoginDuration = parseInt(_get(data, 'general.activeLoginDuration.value'), 10) || 3600; this.lenderTotalLoans = data?.my?.loans?.totalCount ?? 0; - this.isFtdMessageEnable = data?.general?.ftd_message_enable?.value ?? false; - this.ftdCreditAmount = data?.general?.ftd_amount?.value ?? ''; - this.ftdValidDate = data?.general?.ftd_date?.value ?? ''; + // Enable FTDs message from settings + this.isFtdMessageEnable = readBoolSetting(data, 'general.ftd_message_enable.value'); + this.ftdCreditAmount = data?.general?.ftd_message_amount?.value ?? ''; + this.ftdValidDate = data?.general?.ftd_message_valid_date?.value ?? ''; } }, beforeRouteEnter(to, from, next) { diff --git a/src/pages/Thanks/ThanksPage.vue b/src/pages/Thanks/ThanksPage.vue index 4996e20790..e6fec60620 100644 --- a/src/pages/Thanks/ThanksPage.vue +++ b/src/pages/Thanks/ThanksPage.vue @@ -99,6 +99,7 @@