Skip to content

Commit

Permalink
remove dep check in favor of other one
Browse files Browse the repository at this point in the history
  • Loading branch information
natew committed Jul 23, 2024
1 parent 2f533f6 commit 10fa288
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 43 deletions.
43 changes: 1 addition & 42 deletions examples/fullstack/app/api/user+api.ts
Original file line number Diff line number Diff line change
@@ -1,52 +1,11 @@
import { apiRoute } from '~/features/api/apiRoute'
import { ensureAuth } from '~/features/api/ensureAuth'
import type { UserContextType } from '~/features/auth/types'
import {
getMainTeam,
getOrgTeams,
getPersonalTeam,
getProductOwnerships,
getSubscriptions,
getUserAccessInfo,
getUserDetails,
getUserPrivateInfo,
getUserTeams,
} from '~/features/user/helpers'
import type { UserContextType } from '~/features/user/types'

export default apiRoute(async (req) => {
const { supabase, user } = await ensureAuth({ req })

const [
userTeams,
userDetails,
subscriptions,
productOwnerships,
privateInfo,
accessInfo,
] = await Promise.all([
getUserTeams(supabase),
getUserDetails(supabase),
getSubscriptions(supabase),
getProductOwnerships(supabase),
getUserPrivateInfo(user.id),
getUserAccessInfo(supabase, user),
])

return Response.json({
user,
userDetails,
subscriptions,
productOwnerships,
teams: {
all: userTeams,
personal: getPersonalTeam(userTeams, user.id),
orgs: getOrgTeams(userTeams),
main: getMainTeam(userTeams),
},
connections: {
discord: !!privateInfo.discord_token,
github: !!privateInfo.github_token,
},
accessInfo,
} satisfies UserContextType)
})
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"turbo:run": "TURBO_TELEMETRY_DISABLED=1 turbo",
"build": "yarn turbo:run build --filter='*' --filter='!example-*'",
"release": "node -r esbuild-register ./scripts/release.ts",
"check": "turbo check && manypkg check && check-dependency-version-consistency .",
"check": "turbo check && manypkg check",
"clean:build": "yarn turbo:run clean:build",
"clean:ts": "tsc -b --clean tsconfig.json",
"clean": "yarn turbo:run clean:build",
Expand Down

0 comments on commit 10fa288

Please sign in to comment.