refactor: repartition server-side and client-side code
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { ActionFunctionArgs } from '@remix-run/node';
|
||||
import { deleteChat, getUserChatById } from '~/lib/.server/chat';
|
||||
import { errorResponse, successResponse } from '~/utils/api-response';
|
||||
import { deleteChat, getUserChatById } from '~/.server/service/chat';
|
||||
import { errorResponse, successResponse } from '~/.server/utils/api-response';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
const logger = createScopedLogger('api.chat.delete');
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { ActionFunctionArgs } from '@remix-run/node';
|
||||
import { getUserChatById } from '~/lib/.server/chat';
|
||||
import { prisma } from '~/lib/.server/prisma';
|
||||
import { errorResponse, successResponse } from '~/utils/api-response';
|
||||
import { getUserChatById } from '~/.server/service/chat';
|
||||
import { prisma } from '~/.server/service/prisma';
|
||||
import { errorResponse, successResponse } from '~/.server/utils/api-response';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
const logger = createScopedLogger('api.chat.fork');
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { LoaderFunctionArgs } from '@remix-run/node';
|
||||
import { getUserChats } from '~/lib/.server/chat';
|
||||
import { errorResponse, successResponse } from '~/utils/api-response';
|
||||
import { getUserChats } from '~/.server/service/chat';
|
||||
import { errorResponse, successResponse } from '~/.server/utils/api-response';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
const logger = createScopedLogger('api.chat.list');
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { type ActionFunctionArgs, type LoaderFunctionArgs } from '@remix-run/node';
|
||||
import { requireAuth } from '~/lib/.server/auth';
|
||||
import { errorResponse } from '~/utils/api-response';
|
||||
import { requireAuth } from '~/.server/service/auth';
|
||||
import { errorResponse } from '~/.server/utils/api-response';
|
||||
import { handleDeleteAction } from './delete.server';
|
||||
import { handleForkAction } from './fork.server';
|
||||
import { handleListLoader } from './list.server';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ActionFunctionArgs } from '@remix-run/node';
|
||||
import { getUserChatById, updateChat } from '~/lib/.server/chat';
|
||||
import { errorResponse, successResponse } from '~/utils/api-response';
|
||||
import { getUserChatById, updateChat } from '~/.server/service/chat';
|
||||
import { errorResponse, successResponse } from '~/.server/utils/api-response';
|
||||
import { createScopedLogger } from '~/utils/logger';
|
||||
|
||||
const logger = createScopedLogger('api.chat.update');
|
||||
|
||||
Reference in New Issue
Block a user