Skip to content

Commit

Permalink
feat(frontend): adapt to new gql schema
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnisDa committed Dec 3, 2024
1 parent 2bbc143 commit c69dbe4
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ export const action = async ({ request }: ActionFunctionArgs) => {
ImportSource.Imdb,
ImportSource.Goodreads,
ImportSource.OpenScale,
ImportSource.StrongApp,
() => ({
genericCsv: processSubmission(formData, genericCsvImportFormSchema),
}),
Expand All @@ -98,6 +97,9 @@ export const action = async ({ request }: ActionFunctionArgs) => {
urlAndKey: processSubmission(formData, urlAndKeyImportFormSchema),
}),
)
.with(ImportSource.StrongApp, () => ({
strongApp: processSubmission(formData, strongAppImportFormSchema),
}))
.with(ImportSource.Trakt, () => ({
trakt: processSubmission(formData, usernameImportFormSchema),
}))
Expand Down Expand Up @@ -167,6 +169,8 @@ const jellyfinImportFormSchema = usernameImportFormSchema

const genericCsvImportFormSchema = z.object({ csvPath: z.string() });

const strongAppImportFormSchema = z.object({ dataExportPath: z.string() });

const igdbImportFormSchema = z
.object({ collection: z.string() })
.merge(genericCsvImportFormSchema);
Expand Down Expand Up @@ -269,7 +273,6 @@ export default function Page() {
ImportSource.OpenScale,
ImportSource.Goodreads,
ImportSource.Imdb,
ImportSource.StrongApp,
ImportSource.Storygraph,
() => (
<>
Expand All @@ -282,6 +285,16 @@ export default function Page() {
</>
),
)
.with(ImportSource.StrongApp, () => (
<>
<FileInput
required
accept=".csv"
label="CSV file"
name="dataExportPath"
/>
</>
))
.with(ImportSource.Trakt, () => (
<>
<TextInput
Expand Down

0 comments on commit c69dbe4

Please sign in to comment.