Skip to content

Commit

Permalink
fix: bruno queries
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorwlima committed Dec 19, 2023
1 parent 2a3583a commit dccfe28
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions collections/Get Best Assets.bru
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ meta {
}

get {
url: {{SERVER_URL}}/assets/best?sector=Petróleo. Gás e Biocombustíveis&page=1&debt=true&liquidity=true
url: {{SERVER_URL}}/assets/best?page=1&debt=true&liquidity=true
body: none
auth: bearer
}

query {
sector: Petróleo. Gás e Biocombustíveis
subsector:
page: 1
debt: true
liquidity: true
~sector: Petróleo. Gás e Biocombustíveis
}

auth:bearer {
Expand Down
10 changes: 7 additions & 3 deletions server/src/auth/getIsUserPro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,19 @@ type UserStatus = {
}

export const getIsUserPro = async (userId: string): Promise<UserStatus> => {
const user = await clerkClient.users.getUser(userId)

if (
['test', 'development'].includes(env.NODE_ENV) &&
Object.values(testTokens).includes(userId as TestToken)
) {
return { isUserPro: userId === testTokens.PRO, user, domain: null }
return {
isUserPro: userId === testTokens.PRO,
user: {} as Awaited<ReturnType<typeof clerkClient.users.getUser>>,
domain: null,
}
}

const user = await clerkClient.users.getUser(userId)

const userAllowedDomain = allowedDomains.find(
(allowedDomain) =>
user?.emailAddresses.some((email) =>
Expand Down

1 comment on commit dccfe28

@vercel
Copy link

@vercel vercel bot commented on dccfe28 Dec 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.