Skip to content

Commit 2490515

Browse files
committed
linting
1 parent 24c007d commit 2490515

3 files changed

Lines changed: 12 additions & 3 deletions

File tree

apps/website/app/api/supabase/content-embedding/batch/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export const POST = async (request: NextRequest): Promise<NextResponse> => {
104104
const supabase = await createClient();
105105

106106
try {
107-
const body: ContentEmbeddingVecTablesInsert[] = await request.json();
107+
const body = (await request.json()) as ContentEmbeddingVecTablesInsert[];
108108
if (!Array.isArray(body)) {
109109
return createApiResponse(
110110
request,

apps/website/app/api/supabase/content-embedding/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export const POST = async (request: NextRequest): Promise<NextResponse> => {
8080
const supabasePromise = createClient();
8181

8282
try {
83-
const body: ContentEmbeddingVecTablesInsert = await request.json();
83+
const body = (await request.json()) as ContentEmbeddingVecTablesInsert;
8484
const result = await processAndCreateEmbedding(supabasePromise, body);
8585
return createApiResponse(request, result);
8686
} catch (e: unknown) {

apps/website/app/utils/supabase/dbUtils.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ export const getOrCreateEntity = async <T extends TableName>({
111111
}): Promise<PostgrestSingleResponse<Tables<T>>> => {
112112
const result: PostgrestSingleResponse<Tables<T>> = await supabase
113113
.from(tableName)
114+
// Typescript gets confused with latest supabase
115+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
114116
.upsert(insertData as any, {
115117
onConflict: uniqueOn === undefined ? undefined : uniqueOn.join(","),
116118
ignoreDuplicates: false,
@@ -137,8 +139,13 @@ export const getOrCreateEntity = async <T extends TableName>({
137139
continue;
138140
}
139141
reFetchQueryBuilder = reFetchQueryBuilder.eq(
142+
// TS expects those to be known at compile time, but here they are runtime
143+
/* eslint-disable @typescript-eslint/no-explicit-any */
144+
/* eslint-disable @typescript-eslint/no-unsafe-argument */
140145
key as any,
141-
insertData[key] as any, // TS gets confused here?
146+
insertData[key] as any,
147+
/* eslint-enable @typescript-eslint/no-explicit-any */
148+
/* eslint-enable @typescript-eslint/no-unsafe-argument */
142149
);
143150
}
144151
const reFetchResult =
@@ -184,6 +191,8 @@ export const InsertValidatedBatch = async <T extends TableName>({
184191
}): Promise<PostgrestResponse<Tables<T>>> => {
185192
const result: PostgrestResponse<Tables<T>> = await supabase
186193
.from(tableName)
194+
// Typescript gets confused with latest supabase
195+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
187196
.upsert(items as any, {
188197
onConflict: uniqueOn === undefined ? undefined : uniqueOn.join(","),
189198
ignoreDuplicates: false,

0 commit comments

Comments
 (0)