Refactor drizzle and db folder
This commit is contained in:
parent
e96dfb2d74
commit
c493ac342b
31 changed files with 22 additions and 23 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import { z } from 'zod';
|
||||
|
||||
import { createUser, getUser } from '@/db/queries';
|
||||
import { createUser, getUser } from '@/lib/db/queries';
|
||||
|
||||
import { signIn } from './auth';
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { compare } from 'bcrypt-ts';
|
|||
import NextAuth, { User, Session } from 'next-auth';
|
||||
import Credentials from 'next-auth/providers/credentials';
|
||||
|
||||
import { getUser } from '@/db/queries';
|
||||
import { getUser } from '@/lib/db/queries';
|
||||
|
||||
import { authConfig } from './auth.config';
|
||||
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ import {
|
|||
saveDocument,
|
||||
saveMessages,
|
||||
saveSuggestions,
|
||||
} from '@/db/queries';
|
||||
import { Suggestion } from '@/db/schema';
|
||||
} from '@/lib/db/queries';
|
||||
import { Suggestion } from '@/lib/db/schema';
|
||||
import {
|
||||
generateUUID,
|
||||
getMostRecentUserMessage,
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import {
|
|||
deleteDocumentsByIdAfterTimestamp,
|
||||
getDocumentsById,
|
||||
saveDocument,
|
||||
} from '@/db/queries';
|
||||
} from '@/lib/db/queries';
|
||||
|
||||
export async function GET(request: Request) {
|
||||
const { searchParams } = new URL(request.url);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { auth } from '@/app/(auth)/auth';
|
||||
import { getChatsByUserId } from '@/db/queries';
|
||||
import { getChatsByUserId } from '@/lib/db/queries';
|
||||
|
||||
export async function GET() {
|
||||
const session = await auth();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { auth } from '@/app/(auth)/auth';
|
||||
import { getSuggestionsByDocumentId } from '@/db/queries';
|
||||
import { getSuggestionsByDocumentId } from '@/lib/db/queries';
|
||||
|
||||
export async function GET(request: Request) {
|
||||
const { searchParams } = new URL(request.url);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { auth } from '@/app/(auth)/auth';
|
||||
import { getVotesByChatId, voteMessage } from '@/db/queries';
|
||||
import { getVotesByChatId, voteMessage } from '@/lib/db/queries';
|
||||
|
||||
export async function GET(request: Request) {
|
||||
const { searchParams } = new URL(request.url);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { notFound } from 'next/navigation';
|
|||
import { DEFAULT_MODEL_NAME, models } from '@/ai/models';
|
||||
import { auth } from '@/app/(auth)/auth';
|
||||
import { Chat as PreviewChat } from '@/components/custom/chat';
|
||||
import { getChatById, getMessagesByChatId } from '@/db/queries';
|
||||
import { getChatById, getMessagesByChatId } from '@/lib/db/queries';
|
||||
import { convertToUIMessages } from '@/lib/utils';
|
||||
|
||||
export default async function Page(props: { params: Promise<any> }) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue