From 252feb2d96dc35c03abd34afef95cd21902071a1 Mon Sep 17 00:00:00 2001 From: mirovladimitrovski Date: Mon, 19 Jun 2023 14:38:09 +0200 Subject: [PATCH] fix: don't display "first_name" and "surname" custom register fields in registration step 1 --- src/services/inplayer.account.service.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/services/inplayer.account.service.ts b/src/services/inplayer.account.service.ts index d25f7e9e8..5d6bab8b2 100644 --- a/src/services/inplayer.account.service.ts +++ b/src/services/inplayer.account.service.ts @@ -171,7 +171,7 @@ export const getPublisherConsents: GetPublisherConsents = async (config) => { const { data } = await InPlayer.Account.getRegisterFields(jwp?.clientId || ''); const result = data?.collection - .filter((field) => field.name !== 'email_confirmation') + .filter((field) => !['email_confirmation', 'first_name', 'surname'].includes(field.name)) .map( (field): Consent => ({ type: field.type as ConsentFieldVariants, @@ -215,7 +215,12 @@ export const getCustomerConsents: GetCustomerConsents = async (payload) => { export const updateCustomerConsents: UpdateCustomerConsents = async (payload) => { try { const { customer, consents } = payload; - const params = { ...formatUpdateAccount(customer), ...{ metadata: { consents: JSON.stringify(consents) } } }; + const params = { + ...formatUpdateAccount(customer), + metadata: { + consents: JSON.stringify(consents), + }, + }; const { data } = await InPlayer.Account.updateAccount(params);