Skip to content

Commit

Permalink
Merge pull request #127 from vtex-apps/fix/B2BTEAM-1551-isCorporate
Browse files Browse the repository at this point in the history
Adjuste condition is corporate
  • Loading branch information
pabloppupulin authored Feb 9, 2024
2 parents a33d0fb + 1fd1fea commit 6acf447
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Fixed

- Fix IsCorporate in SetProfile

## [1.39.0] - 2024-02-06

### Added
Expand Down
2 changes: 2 additions & 0 deletions node/resolvers/Routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ export const Routes = {
const b2bImpersonate = body?.public?.impersonate?.value
const telemarketingImpersonate = body?.impersonate?.storeUserId?.value
const orderFormId = body?.checkout?.orderFormId?.value
const isCorporate = true

let email = body?.authentication?.storeUserEmail?.value
let businessName = null
Expand Down Expand Up @@ -518,6 +519,7 @@ export const Routes = {
phoneNumber,
stateRegistration,
tradeName,
isCorporate,
})

if (clUser && orderFormId) {
Expand Down
4 changes: 3 additions & 1 deletion node/resolvers/Routes/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export const generateClUser = async ({
businessName,
businessDocument,
tradeName,
isCorporate,
stateRegistration,
ctx,
}: {
Expand All @@ -94,6 +95,7 @@ export const generateClUser = async ({
businessName: string | null
businessDocument: string | null
tradeName: string | null
isCorporate: boolean
stateRegistration: string | null
ctx: Context
}) => {
Expand Down Expand Up @@ -121,7 +123,7 @@ export const generateClUser = async ({
clUser.phone = phoneNumber
}

if (businessName && businessDocument) {
if (isCorporate) {
clUser.isCorporate = true
clUser.document = null
clUser.corporateName = businessName
Expand Down

0 comments on commit 6acf447

Please sign in to comment.