Skip to content

Commit

Permalink
fix: remove not used function graphqlB2BWithBCCustomerToken (#1018)
Browse files Browse the repository at this point in the history
* fix: remove graphqlB2BWithBCCustomerToken due it's not used

* fix: assignation within a scope
  • Loading branch information
bc-marco authored Apr 26, 2024
1 parent 5a5aa16 commit df9125c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 20 deletions.
3 changes: 1 addition & 2 deletions apps/storefront/src/shared/routes/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,6 @@ const denyInvoiceRoles = [4, 99, 100]

const invoiceFlag = 'invoice?invoiceId'

const { hash, pathname, href } = window.location

const getAllowedRoutes = (globalState: GlobalState): RouteItem[] => {
const { storefrontConfig, quoteConfig } = globalState
const { company } = store.getState()
Expand Down Expand Up @@ -412,6 +410,7 @@ const gotoAllowedAppPage = async (
gotoPage: (url: string) => void,
isAccountEnter?: boolean
) => {
const { hash, pathname, href } = window.location
const currentState = store.getState()
const isLoggedIn =
currentState.company.customer || role !== CustomerRole.GUEST
Expand Down
8 changes: 4 additions & 4 deletions apps/storefront/src/shared/service/b2b/graphql/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { convertArrayToGraphql, storeHash } from '@/utils'
import B3Request from '../../request/b3Fetch'

const getB2BTokenQl = (
currentCustomerJWTToken: string,
currentCustomerJWT: string,
channelId: number
) => `mutation {
authorization(authData: {
bcToken: "${currentCustomerJWTToken}"
bcToken: "${currentCustomerJWT}"
channelId: ${channelId}
}) {
result {
Expand Down Expand Up @@ -199,11 +199,11 @@ const companyCreditConfig = () => `{
}`

export const getB2BToken = (
currentCustomerJWTToken: string,
currentCustomerJWT: string,
channelId = 1
): CustomFieldItems =>
B3Request.graphqlB2B({
query: getB2BTokenQl(currentCustomerJWTToken, channelId),
query: getB2BTokenQl(currentCustomerJWT, channelId),
})

export const getAgentInfo = (customerId: string | number): CustomFieldItems =>
Expand Down
14 changes: 0 additions & 14 deletions apps/storefront/src/shared/service/request/b3Fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,6 @@ const B3Request = {
}
return graphqlRequest(RequestType.B2BGraphql, data, config, customMessage)
},
/**
* super admin / pending company
* Request to B2B graphql API using BC JWT Token
*/
graphqlB2BWithBCCustomerToken: function post<T>(
data: T,
customMessage = false
): Promise<any> {
const { currentCustomerJWT } = store.getState().company.tokens
const config = {
Authorization: `Bearer ${currentCustomerJWT}`,
}
return graphqlRequest(RequestType.B2BGraphql, data, config, customMessage)
},
/**
* @deprecated use {@link B3Request.graphqlBCProxy} instead
* Request to BC graphql API using BC graphql token
Expand Down

0 comments on commit df9125c

Please sign in to comment.