Skip to content

Commit 961bd4e

Browse files
fix: build and linter issues
1 parent 7990634 commit 961bd4e

File tree

2 files changed

+10
-14
lines changed
  • src

2 files changed

+10
-14
lines changed

src/app/api/beanconqueror/qr/route.ts

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import { beanInformationFormSchema } from "@/lib/beanconqueror/validations/bean-information-form-schema";
2-
import { ZodIssue } from "zod";
32
import { createUrlFromFormSchema } from "@/lib/beanconqueror/proto/proto-helpers";
43
import { NextResponse } from "next/server";
54
import { getBeanLink } from "@/lib/beanlink";
65

7-
export async function GET() {
6+
export function GET() {
87
return NextResponse.json({
98
example: {
109
"coffeeName": "Ethiopian Yirgacheffe",
@@ -39,25 +38,22 @@ export async function GET() {
3938
}
4039
]
4140
}
42-
})
41+
});
4342
}
4443

45-
export async function POST(
46-
req: Request,
47-
) {
48-
const json = await req.json()
49-
const body = beanInformationFormSchema.safeParse(json)
44+
export async function POST(req: Request) {
45+
const body = beanInformationFormSchema.safeParse((await req.json()));
5046

5147
if (!body.success) {
52-
const { errors } = body.error
48+
const { errors } = body.error;
5349

5450
return NextResponse.json({
5551
error: { message: "Invalid request data", errors }
56-
}, { status: 400 })
52+
}, { status: 400 });
5753
}
5854

59-
const beanconquerorUrl = createUrlFromFormSchema(body.data)
60-
const beanLink = await getBeanLink(beanconquerorUrl)
55+
const beanconquerorUrl = createUrlFromFormSchema(body.data);
56+
const beanLink = await getBeanLink(beanconquerorUrl);
6157

62-
return NextResponse.json({ qr: beanLink })
58+
return NextResponse.json({ qr: beanLink });
6359
}

src/components/forms/bean-information-form/form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import {
3131
defaultVarietyInformation,
3232
beanInformationFormSchema,
3333
} from "@/lib/beanconqueror/validations/bean-information-form-schema";
34-
import { BeanLinkResponse, getBeanLink } from "@/lib/beanlink";
34+
import { type BeanLinkResponse, getBeanLink } from "@/lib/beanlink";
3535

3636
export default function BeanInformationForm() {
3737
const [activeTab, setActiveTab] = useState<"general" | "variety">("general");

0 commit comments

Comments
 (0)