diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 6b10a5b..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": [ - "next/core-web-vitals", - "next/typescript" - ] -} diff --git a/next.config.ts b/next.config.ts index f70b91f..e9ffa30 100644 --- a/next.config.ts +++ b/next.config.ts @@ -2,9 +2,6 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { /* config options here */ - eslint: { - ignoreDuringBuilds: true, - }, }; export default nextConfig; diff --git a/prisma/migrations/20250110112752_source_column_types/migration.sql b/prisma/migrations/20250110112752_source_column_types/migration.sql new file mode 100644 index 0000000..d89277f --- /dev/null +++ b/prisma/migrations/20250110112752_source_column_types/migration.sql @@ -0,0 +1,16 @@ +/* + Warnings: + + - You are about to drop the column `filename` on the `Source` table. All the data in the column will be lost. + - You are about to drop the column `nickname` on the `Source` table. All the data in the column will be lost. + - Added the required column `fileName` to the `Source` table without a default value. This is not possible if the table is not empty. + - Added the required column `fileType` to the `Source` table without a default value. This is not possible if the table is not empty. + - Added the required column `nickName` to the `Source` table without a default value. This is not possible if the table is not empty. + +*/ +-- AlterTable +ALTER TABLE "Source" DROP COLUMN "filename", +DROP COLUMN "nickname", +ADD COLUMN "fileName" TEXT NOT NULL, +ADD COLUMN "fileType" TEXT NOT NULL, +ADD COLUMN "nickName" TEXT NOT NULL; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 3564afa..9dab2dc 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -78,8 +78,9 @@ model Sheet { model Source { id String @id @default(uuid()) - filename String - nickname String + fileName String + fileType String + nickName String isIndexed Boolean @default(false) organizationId String organization Organization @relation(fields: [organizationId], references: [id]) diff --git a/src/app/console/actions.ts b/src/app/console/actions.ts index 29b4b24..312d73e 100644 --- a/src/app/console/actions.ts +++ b/src/app/console/actions.ts @@ -149,10 +149,10 @@ export async function getUploadUrlForSource(filename: string) { } } -export async function addSource(name: string, filename: string) { +export async function addSource(nickName: string, fileName: string, fileType: string) { const { organizationId } = await getAuthToken() await prisma.source.create({ - data: { nickname: name, filename, organizationId }, + data: { nickName, fileName, fileType, organizationId }, }) return diff --git a/src/app/console/sheets/[slug]/actions.ts b/src/app/console/sheets/[slug]/actions.ts index 162dbd9..85f8dd9 100644 --- a/src/app/console/sheets/[slug]/actions.ts +++ b/src/app/console/sheets/[slug]/actions.ts @@ -22,7 +22,7 @@ export const fetchSheet = async (id: string) => { source: { select: { id: true, - nickname: true + nickName: true } } } diff --git a/src/app/console/sheets/[slug]/sourcesDialog.tsx b/src/app/console/sheets/[slug]/sourcesDialog.tsx index 5edf3f3..2b5ec90 100644 --- a/src/app/console/sheets/[slug]/sourcesDialog.tsx +++ b/src/app/console/sheets/[slug]/sourcesDialog.tsx @@ -41,7 +41,7 @@ export default function SourcesDialog({ sheetId, onAdd }: { sheetId: string, onA } const filteredSources = sources.filter(source => - source.nickname.toLowerCase().includes(search.toLowerCase()) + source.nickName.toLowerCase().includes(search.toLowerCase()) ) return ( @@ -56,7 +56,7 @@ export default function SourcesDialog({ sheetId, onAdd }: { sheetId: string, onA
-

{source.nickname}

+

{source.nickName}

{source.isIndexed ? "Indexed" : "Not indexed"}

diff --git a/src/app/console/sourcesDialog.tsx b/src/app/console/sourcesDialog.tsx index 0bdf356..1bc237b 100644 --- a/src/app/console/sourcesDialog.tsx +++ b/src/app/console/sourcesDialog.tsx @@ -39,7 +39,7 @@ export default function SourcesDialog() { await instance.put(url, file) // Save source in database - await addSource(file.name, filename) + await addSource(file.name, filename, file.type) // Refresh sources list await fetchData() @@ -73,7 +73,7 @@ export default function SourcesDialog() { } const filteredSources = sources.filter(source => - source.nickname.toLowerCase().includes(search.toLowerCase()) + source.nickName.toLowerCase().includes(search.toLowerCase()) ) return ( @@ -100,7 +100,7 @@ export default function SourcesDialog() {
-

{source.nickname}

+

{source.nickName}

{source.isIndexed ? 'Indexed' : 'Not indexed'}