Skip to content

Commit e514eb1

Browse files
committed
chore(backend): fix types due to /route http method change
1 parent 1567ae3 commit e514eb1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

backend/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ app.get("/congestions", async (req: Request, res: Response) => {
4242
});
4343
app.post("/route", async (req: Request, res: Response) => {
4444
const r =
45-
req.body as paths["/route"]["get"]["requestBody"]["content"]["application/json"];
45+
req.body as paths["/route"]["post"]["requestBody"]["content"]["application/json"];
4646
if (r.src.kind === "location" && r.dest.kind == "location") {
4747
const routes = await routing.route(r.src.location!, r.dest.location!);
4848
console.log(JSON.stringify(routes, null, 2));

backend/services/routing.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const OSRMText = require("osrm-text-instructions")("v5");
1212

1313
type Location = components["schemas"]["Location"];
1414
type Routes = NonNullable<
15-
paths["/route"]["get"]["responses"]["200"]["content"]["application/json"]["routes"]
15+
paths["/route"]["post"]["responses"]["200"]["content"]["application/json"]["routes"]
1616
>;
1717

1818
export const ROUTING_API =

0 commit comments

Comments
 (0)