mirror of https://github.com/buster-so/buster.git
remove throw pages
This commit is contained in:
parent
d3e480b133
commit
dae01a103c
|
@ -1,42 +0,0 @@
|
||||||
import { createFileRoute, useNavigate } from '@tanstack/react-router';
|
|
||||||
import { z } from 'zod';
|
|
||||||
import { useMount } from '../hooks/useMount';
|
|
||||||
|
|
||||||
export const Route = createFileRoute('/app/throw')({
|
|
||||||
validateSearch: z.object({
|
|
||||||
iterations: z.number().optional(),
|
|
||||||
}),
|
|
||||||
component: RouteComponent,
|
|
||||||
beforeLoad: ({ search }) => {
|
|
||||||
return {
|
|
||||||
iterations: search.iterations,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
loader: async ({ context }) => {
|
|
||||||
return {
|
|
||||||
iterations: context.iterations,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
head: ({ loaderData }) => {
|
|
||||||
return {
|
|
||||||
meta: [
|
|
||||||
{
|
|
||||||
title: `Throw ${loaderData?.iterations}`,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
function RouteComponent() {
|
|
||||||
const navigate = useNavigate();
|
|
||||||
const { iterations } = Route.useSearch();
|
|
||||||
|
|
||||||
useMount(() => {
|
|
||||||
setTimeout(() => {
|
|
||||||
navigate({ to: '/app/throw2', replace: true, search: { iterations: (iterations ?? 0) + 1 } });
|
|
||||||
}, 1000);
|
|
||||||
});
|
|
||||||
|
|
||||||
return <div className="bg-red-100">Hello "/app/throw"! </div>;
|
|
||||||
}
|
|
|
@ -1,43 +0,0 @@
|
||||||
import { createFileRoute, useNavigate } from '@tanstack/react-router';
|
|
||||||
import { z } from 'zod';
|
|
||||||
import { useMount } from '@/hooks/useMount';
|
|
||||||
|
|
||||||
const searchParamsSchema = z.object({
|
|
||||||
iterations: z.number().optional(),
|
|
||||||
});
|
|
||||||
|
|
||||||
export const Route = createFileRoute('/app/throw2')({
|
|
||||||
validateSearch: searchParamsSchema,
|
|
||||||
component: RouteComponent,
|
|
||||||
beforeLoad: ({ search }) => {
|
|
||||||
return {
|
|
||||||
iterations: search.iterations,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
loader: async ({ context }) => {
|
|
||||||
return {
|
|
||||||
iterations: context.iterations,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
head: ({ loaderData }) => {
|
|
||||||
return {
|
|
||||||
meta: [
|
|
||||||
{
|
|
||||||
title: `Throw ${loaderData?.iterations}`,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
function RouteComponent() {
|
|
||||||
const navigate = useNavigate();
|
|
||||||
const { iterations } = Route.useSearch();
|
|
||||||
useMount(() => {
|
|
||||||
setTimeout(() => {
|
|
||||||
navigate({ to: '/app/throw', replace: true, search: { iterations: (iterations ?? 0) + 1 } });
|
|
||||||
}, 1000);
|
|
||||||
});
|
|
||||||
|
|
||||||
return <div className="bg-blue-100">Hello "/app/throw2"!</div>;
|
|
||||||
}
|
|
|
@ -42,9 +42,9 @@ async function upsertData(tx: any, tableName: string, table: any, data: any[]) {
|
||||||
try {
|
try {
|
||||||
// Fix YAML content in datasets table by converting literal \n to actual newlines
|
// Fix YAML content in datasets table by converting literal \n to actual newlines
|
||||||
if (tableName === 'datasets') {
|
if (tableName === 'datasets') {
|
||||||
data = data.map(record => ({
|
data = data.map((record) => ({
|
||||||
...record,
|
...record,
|
||||||
ymlFile: record.ymlFile ? record.ymlFile.replace(/\\n/g, '\n') : record.ymlFile
|
ymlFile: record.ymlFile ? record.ymlFile.replace(/\\n/g, '\n') : record.ymlFile,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
// For tables that should always use ON CONFLICT DO NOTHING instead of updating
|
// For tables that should always use ON CONFLICT DO NOTHING instead of updating
|
||||||
|
|
Loading…
Reference in New Issue