Skip to content

Commit a79f943

Browse files
committed
fix: bug returning undefined from area.byCode
1 parent 6ee24df commit a79f943

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/server/trpc/routers/area.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ export const areaRouter = router({
1717
code: z.string(),
1818
}),
1919
)
20-
.query(({ input: { code, areaSetCode } }) => {
21-
return findAreaByCodeWithGeometry(code, areaSetCode);
20+
.query(async ({ input: { code, areaSetCode } }) => {
21+
const area = await findAreaByCodeWithGeometry(code, areaSetCode);
22+
return area ?? null;
2223
}),
2324
search: protectedProcedure
2425
.input(

0 commit comments

Comments
 (0)