Skip to content

Commit

Permalink
fix(example): migrate to new usage for valibot
Browse files Browse the repository at this point in the history
  • Loading branch information
Dung Huynh Duc committed Jul 22, 2024
1 parent dc67ab1 commit fc84b3f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
6 changes: 3 additions & 3 deletions example/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import '../styles/globals.css'
import '../styles/globals.css';

function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />
return <Component {...pageProps} />;
}

export default MyApp
export default MyApp;
4 changes: 2 additions & 2 deletions example/pages/api/greeter.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { NextApiRequest, NextApiResponse } from 'next';
import type { NextApiRequest, NextApiResponse } from 'next';
import { withValidation } from 'next-validations';
import * as valibot from 'valibot';

const schema = valibot.object({
name: valibot.string([valibot.minLength(4)]),
name: valibot.pipe(valibot.string(), valibot.minLength(4)),
});

const validate = withValidation({
Expand Down
2 changes: 1 addition & 1 deletion example/pages/api/support.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Joi from 'joi';
import { NextApiRequest, NextApiResponse } from 'next';
import type { NextApiRequest, NextApiResponse } from 'next';
import { createRouter } from 'next-connect';
import { withValidations } from 'next-validations';
import { NextResponse } from 'next/server';
Expand Down
2 changes: 0 additions & 2 deletions example/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,8 @@ export default function Home() {
</p>
</a>
<Link href="/playground" className={styles.card}>

<h2>API Playground &rarr;</h2>
<p>Swagger UI</p>

</Link>
</div>
</main>
Expand Down

0 comments on commit fc84b3f

Please sign in to comment.