Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
vhaalmeida committed Aug 30, 2024
1 parent f0db88c commit 4818d99
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
6 changes: 5 additions & 1 deletion node/clients/storefrontPermissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ export default class StorefrontPermissions extends AppGraphQLClient {
})
}

public getOrganizationsByEmailPaginated = async (email: string, page: number, pageSize: number): Promise<any> => {
public getOrganizationsByEmailPaginated = async (
email: string,
page: number,
pageSize: number
): Promise<any> => {

Check warning on line 48 in node/clients/storefrontPermissions.ts

View workflow job for this annotation

GitHub Actions / QE / Lint Node.js

Unexpected any. Specify a different type
return this.query({
extensions: this.getPersistedQuery(),
query: getOrganizationsByEmailPaginated,
Expand Down
30 changes: 17 additions & 13 deletions node/resolvers/Queries/Organizations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,6 @@ const Organizations = {
)
})

console.log(`organizations`, organizations)

try {
return organizations
} catch (error) {
Expand Down Expand Up @@ -259,7 +257,6 @@ const Organizations = {
vtex: { logger, sessionToken, adminUserAuthToken },
}: any
) => {

const organizationFilters: string[] = []
let fromSession = false
const {
Expand Down Expand Up @@ -316,23 +313,30 @@ const Organizations = {
}
}

const response = await storefrontPermissions.getOrganizationsByEmailPaginated(email, page, pageSize)
const response =
await storefrontPermissions.getOrganizationsByEmailPaginated(
email,
page,
pageSize
)

const organizations = response?.data?.getOrganizationsByEmailPaginated?.data?.filter(({ orgId }: { orgId: string }) => {
return (
fromSession ||
(organizationFilters.length > 0
? organizationFilters.find((id: string) => orgId === id)
: true)
const organizations =
response?.data?.getOrganizationsByEmailPaginated?.data?.filter(
({ orgId }: { orgId: string }) => {
return (
fromSession ||
(organizationFilters.length > 0
? organizationFilters.find((id: string) => orgId === id)
: true)
)
}
)
})

try {
return {
data: organizations,
pagination: response.data?.getOrganizationsByEmailPaginated?.pagination
pagination: response.data?.getOrganizationsByEmailPaginated?.pagination,
}

} catch (error) {
logger.error({
error,
Expand Down

0 comments on commit 4818d99

Please sign in to comment.