fix(tsc): string pagination params

This commit is contained in:
Nicolas Meienberger 2026-01-31 15:35:19 +01:00
parent f37ae0484b
commit c6955b4283
4 changed files with 12 additions and 6 deletions

View file

@ -78,7 +78,7 @@ export function RestoreForm({ snapshot, repository, snapshotId, returnPath }: Re
return await queryClient.ensureQueryData( return await queryClient.ensureQueryData(
listSnapshotFilesOptions({ listSnapshotFilesOptions({
path: { id: repository.id, snapshotId }, path: { id: repository.id, snapshotId },
query: { path, offset, limit: 500 }, query: { path, offset: offset.toString(), limit: "500" },
}), }),
); );
}, },
@ -86,7 +86,7 @@ export function RestoreForm({ snapshot, repository, snapshotId, returnPath }: Re
void queryClient.prefetchQuery( void queryClient.prefetchQuery(
listSnapshotFilesOptions({ listSnapshotFilesOptions({
path: { id: repository.id, snapshotId }, path: { id: repository.id, snapshotId },
query: { path, offset: 0, limit: 500 }, query: { path, offset: "0", limit: "500" },
}), }),
); );
}, },

View file

@ -42,7 +42,7 @@ export const VolumeFileBrowser = ({
return await queryClient.ensureQueryData( return await queryClient.ensureQueryData(
listFilesOptions({ listFilesOptions({
path: { id: volumeId }, path: { id: volumeId },
query: { path, offset }, query: { path, offset: offset?.toString() },
}), }),
); );
}, },

View file

@ -671,14 +671,20 @@ export const CreateScheduleForm = ({ initialValues, formId, onSubmit, volume }:
<div> <div>
<p className="text-xs uppercase text-muted-foreground">Include paths/patterns</p> <p className="text-xs uppercase text-muted-foreground">Include paths/patterns</p>
<div className="flex flex-col gap-1"> <div className="flex flex-col gap-1">
{formValues.includePatterns?.map((path) => ( {formValues.includePatterns?.slice(0, 20).map((path) => (
<span key={path} className="text-xs font-mono bg-accent px-1.5 py-0.5 rounded"> <span key={path} className="text-xs font-mono bg-accent px-1.5 py-0.5 rounded">
{path} {path}
</span> </span>
))} ))}
{formValues.includePatterns && formValues.includePatterns.length > 20 && (
<span className="text-xs text-muted-foreground">
+ {formValues.includePatterns.length - 20} more
</span>
)}
{formValues.includePatternsText {formValues.includePatternsText
?.split("\n") ?.split("\n")
.filter(Boolean) .filter(Boolean)
.slice(0, 20 - (formValues.includePatterns?.length || 0))
.map((pattern) => ( .map((pattern) => (
<span key={pattern} className="text-xs font-mono bg-accent px-1.5 py-0.5 rounded"> <span key={pattern} className="text-xs font-mono bg-accent px-1.5 py-0.5 rounded">
{pattern.trim()} {pattern.trim()}

View file

@ -64,7 +64,7 @@ export const SnapshotFileBrowser = (props: Props) => {
return await queryClient.ensureQueryData( return await queryClient.ensureQueryData(
listSnapshotFilesOptions({ listSnapshotFilesOptions({
path: { id: repositoryId, snapshotId: snapshot.short_id }, path: { id: repositoryId, snapshotId: snapshot.short_id },
query: { path, offset, limit: 500 }, query: { path, offset: offset.toString(), limit: "500" },
}), }),
); );
}, },
@ -72,7 +72,7 @@ export const SnapshotFileBrowser = (props: Props) => {
void queryClient.prefetchQuery( void queryClient.prefetchQuery(
listSnapshotFilesOptions({ listSnapshotFilesOptions({
path: { id: repositoryId, snapshotId: snapshot.short_id }, path: { id: repositoryId, snapshotId: snapshot.short_id },
query: { path, offset: 0, limit: 500 }, query: { path, offset: "0", limit: "500" },
}), }),
); );
}, },