Skip to content

Commit

Permalink
Merge pull request #13 from Bensigo/development
Browse files Browse the repository at this point in the history
fix: update
  • Loading branch information
Bensigo authored Oct 12, 2023
2 parents 3731243 + 5a759f5 commit 7255cd4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/env.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const env = createEnv({
*/
server: {
DATABASE_URL: z.string().url(),
// DIRECT_DATABASE_URL: z.string().url(),
DIRECT_DATABASE_URL: z.string().url(),
NODE_ENV: z.enum(["development", "test", "production"]),
NEXTAUTH_SECRET:
process.env.NODE_ENV === "production"
Expand Down
15 changes: 7 additions & 8 deletions src/pages/api/v2/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { withAccelerate } from '@prisma/extension-accelerate';
import { OpenAIStream, StreamingTextResponse } from 'ai'
import { Configuration, OpenAIApi } from 'openai-edge'
import { env } from "@/env.mjs";
import { auth } from "../auth/[...nextauth]";



Expand All @@ -20,14 +19,14 @@ export default async function POST(req: Request) {

// handle auth
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
const session = req.headers.getSetCookie()
// const session = req.headers.getSetCookie()

console.log({ session })
if (!session){
return new Response('Unauthorized', {
status: 401
})
}
// console.log({ session })
// if (!session){
// return new Response('Unauthorized', {
// status: 401
// })
// }


const prisma = new PrismaClient().$extends(withAccelerate());
Expand Down
5 changes: 1 addition & 4 deletions src/shared-ui/ZenQuestCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ export default function ZenQuestCard(props: ZenQuestCardProps) {
mutate({ id: props.id }, {
onSuccess: () => {
const ctx = api.useContext()
const invalidateListQuest = async() => await ctx.quest.list.reset({
filter: props.selectedFilter,
take: 20
})
const invalidateListQuest = async() => await ctx.quest.list.reset()
void invalidateListQuest()
// refresh
}
Expand Down

0 comments on commit 7255cd4

Please sign in to comment.