Merged in chore/refactor-hotel-trpc-routes (pull request #2891)
Chore/refactor hotel trpc routes * chore(SW-3519): refactor trpc hotel routers * chore(SW-3519): refactor trpc hotel routers * refactor * merge * Merge branch 'master' of bitbucket.org:scandic-swap/web into chore/refactor-hotel-trpc-routes Approved-by: Linus Flood
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import { notFound } from "next/navigation"
|
||||
import { NextResponse } from "next/server"
|
||||
|
||||
import { logger } from "@scandic-hotels/common/logger"
|
||||
|
||||
import { env } from "@/env/server"
|
||||
|
||||
import { auth } from "@/auth"
|
||||
@@ -13,6 +11,12 @@ export const GET = async () => {
|
||||
}
|
||||
|
||||
const user = await auth()
|
||||
logger.debug("[DEBUG] access-token", user?.token)
|
||||
return NextResponse.json(user)
|
||||
const sortedEnv = Object.keys(env)
|
||||
.sort()
|
||||
.reduce<Record<string, unknown>>((acc, key) => {
|
||||
acc[key] = env[key as keyof typeof env]
|
||||
return acc
|
||||
}, {})
|
||||
|
||||
return NextResponse.json({ user, env: sortedEnv })
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { getServiceToken } from "@scandic-hotels/common/tokenManager"
|
||||
import { getCountries } from "@scandic-hotels/trpc/routers/hotels/utils"
|
||||
import { getCountries } from "@scandic-hotels/trpc/routers/hotels/services/getCountries"
|
||||
|
||||
import type { Lang } from "@scandic-hotels/common/constants/language"
|
||||
|
||||
|
||||
@@ -2,10 +2,8 @@ import { Lang } from "@scandic-hotels/common/constants/language"
|
||||
import { createLogger } from "@scandic-hotels/common/logger/createLogger"
|
||||
import { getServiceToken } from "@scandic-hotels/common/tokenManager"
|
||||
import { safeTry } from "@scandic-hotels/common/utils/safeTry"
|
||||
import {
|
||||
getCountries,
|
||||
getHotelIdsByCountry,
|
||||
} from "@scandic-hotels/trpc/routers/hotels/utils"
|
||||
import { getCountries } from "@scandic-hotels/trpc/routers/hotels/services/getCountries"
|
||||
import { getHotelIdsByCountry } from "@scandic-hotels/trpc/routers/hotels/services/getHotelIdsByCountry"
|
||||
|
||||
import type { WarmupFunction, WarmupResult } from "."
|
||||
|
||||
|
||||
Reference in New Issue
Block a user