Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjuste condition is corporate #127

Merged
merged 11 commits into from
Feb 9, 2024
Merged
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
Loading