Skip to content

Commit

Permalink
linter spread fix
Browse files Browse the repository at this point in the history
  • Loading branch information
overmode committed Jan 14, 2025
1 parent 95f751f commit c5c5d8e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions front/lib/api/files/upsert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ const upsertDocumentToDatasource: ProcessingFunction = async ({
// Use the file id as the document id to make it easy to track the document back to the file.
const sourceUrl = file.getPrivateUrl(auth);

const { title: upsertTitle, ...restArgs } = upsertArgs ?? {};
const upsertDocumentRes = await upsertDocument({
document_id: file.sId,
source_url: sourceUrl,
Expand All @@ -223,10 +224,10 @@ const upsertDocumentToDatasource: ProcessingFunction = async ({
dataSource,
auth,
mime_type: file.contentType,
title: file.fileName,
title: upsertTitle ?? file.fileName,

// Used to override defaults.
...(upsertArgs ?? {}),
...restArgs,
});

if (upsertDocumentRes.isErr()) {
Expand All @@ -253,6 +254,7 @@ const upsertTableToDatasource: ProcessingFunction = async ({
if (upsertArgs && "tableId" in upsertArgs) {
tableId = upsertArgs.tableId ?? tableId;
}
const { title: upsertTitle, ...restArgs } = upsertArgs ?? {};
const upsertTableRes = await upsertTable({
tableId,
name: slugify(file.fileName),
Expand All @@ -265,11 +267,11 @@ const upsertTableToDatasource: ProcessingFunction = async ({
dataSource,
auth,
useAppForHeaderDetection: true,
title: file.fileName,
title: upsertTitle ?? file.fileName,
mimeType: file.contentType,

// Used to override defaults, for manual file uploads where some fields are user-defined.
...(upsertArgs ?? {}),
...restArgs,
});

if (upsertTableRes.isErr()) {
Expand Down

0 comments on commit c5c5d8e

Please sign in to comment.