Skip to content

Commit

Permalink
fix: await lol
Browse files Browse the repository at this point in the history
  • Loading branch information
qin-guan committed Jul 16, 2023
1 parent 9d92f16 commit ce18424
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,18 @@ export default defineNuxtConfig({
devStorage: {
driver: 'memory',
},
redis: (() => (process.env.NUXT_ENABLE_REDIS
redis: (() => (!process.env.NUXT_ENABLE_REDIS
? {
driver: 'redis',
port: process.env.NUXT_REDIS_PORT,
host: process.env.NUXT_REDIS_HOST,
username: process.env.NUXT_REDIS_USERNAME,
password: process.env.NUXT_REDIS_PASSWORD,
}
: undefined))(),
: {
driver: 'memory',
}
))(),
},
},

Expand Down
4 changes: 2 additions & 2 deletions server/trpc/routers/me/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const meRouter = router({
if (await userStorage.hasItem(ctx.session.user.id))
return await userStorage.getItem<User>(ctx.session.user.id)

const user = ctx.prisma.user.findUniqueOrThrow({
const user = await ctx.prisma.user.findUniqueOrThrow({
where: { id: ctx.session.user.id },
select: defaultUserSelect,
})
Expand All @@ -30,7 +30,7 @@ export const meRouter = router({
}),
)
.mutation(async ({ ctx, input }) => {
const user = ctx.prisma.user.update({
const user = await ctx.prisma.user.update({
where: { id: ctx.session.user.id },
data: input,
})
Expand Down

0 comments on commit ce18424

Please sign in to comment.