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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Fixed
- Fix IsCorporate in SetProfile

## [1.38.0] - 2023-12-14

### Added
3 changes: 3 additions & 0 deletions node/resolvers/Routes/index.ts
Original file line number Diff line number Diff line change
@@ -310,6 +310,8 @@ export const Routes = {
}
}

const isCorporate = Boolean(organization)

businessName = organization.name
tradeName = organization.tradeName

@@ -509,6 +511,7 @@ export const Routes = {
phoneNumber,
stateRegistration,
tradeName,
isCorporate,
})

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

Unchanged files with check annotations Beta

})
}
public async getSessions({ headers }: any): Promise<any> {

Check warning on line 11 in node/clients/FullSessions.ts

GitHub Actions / QE / Lint Node.js

Unexpected any. Specify a different type

Check warning on line 11 in node/clients/FullSessions.ts

GitHub Actions / QE / Lint Node.js

Unexpected any. Specify a different type
return this.http.get('/api/sessions?items=*', {
headers,
})
})
}
public async validateToken({ token }: { token: string }): Promise<any> {

Check warning on line 14 in node/clients/IdentityClient.ts

GitHub Actions / QE / Lint Node.js

Unexpected any. Specify a different type
return this.http.post('/api/vtexid/credential/validate', { token })
}
}
private query = async (param: {
query: string
variables: any

Check warning on line 72 in node/clients/Organizations.ts

GitHub Actions / QE / Lint Node.js

Unexpected any. Specify a different type
extensions: any

Check warning on line 73 in node/clients/Organizations.ts

GitHub Actions / QE / Lint Node.js

Unexpected any. Specify a different type
}) => {
const { query, variables, extensions } = param
})
}
public addItem = (orderFormId: string, items: any) =>

Check warning on line 70 in node/clients/checkout.ts

GitHub Actions / QE / Lint Node.js

Unexpected any. Specify a different type
this.post<OrderForm>(
this.routes.addItem(orderFormId, this.getChannelQueryString()),
{ orderItems: items },
orderFormId: string,
appId: string,
field: string,
value: any

Check warning on line 88 in node/clients/checkout.ts

GitHub Actions / QE / Lint Node.js

Unexpected any. Specify a different type
) =>
this.put(
this.routes.orderFormCustomData(orderFormId, appId, field),
{ metric: 'checkout-setOrderFormCustomData' }
)
public updateItems = (orderFormId: string, orderItems: any) =>

Check warning on line 96 in node/clients/checkout.ts

GitHub Actions / QE / Lint Node.js

Unexpected any. Specify a different type
this.post(
this.routes.updateItems(orderFormId),
{ orderItems },
{ metric: 'checkout-updateOrderFormIgnoreProfile' }
)
public updateOrderFormPayment = (orderFormId: string, payments: any) =>

Check warning on line 113 in node/clients/checkout.ts

GitHub Actions / QE / Lint Node.js

Unexpected any. Specify a different type
this.post(
this.routes.attachmentsData(orderFormId, 'paymentData'),
{ payments },
{ metric: 'checkout-updateOrderFormPayment' }
)
public updateOrderFormProfile = (orderFormId: string, fields: any) =>

Check warning on line 120 in node/clients/checkout.ts

GitHub Actions / QE / Lint Node.js

Unexpected any. Specify a different type
this.post(
this.routes.attachmentsData(orderFormId, 'clientProfileData'),
fields,