| 25 | } |
| 26 | |
| 27 | export const getRoutingModeHandler: Handler<HonoEnv> = async c => { |
| 28 | const parsed = AutoRoutingModeOwnerQuerySchema.safeParse({ |
| 29 | ownerType: c.req.query('ownerType'), |
| 30 | ownerId: c.req.query('ownerId'), |
| 31 | }); |
| 32 | if (!parsed.success) { |
| 33 | return c.json({ error: 'Invalid routing mode owner' }, 400); |
| 34 | } |
| 35 | |
| 36 | const configuredMode = await getConfiguredAutoRoutingMode(c.env, parsed.data); |
| 37 | return c.json(responseBody({ ...parsed.data, configuredMode })); |
| 38 | }; |
| 39 | |
| 40 | export const putRoutingModeHandler: Handler<HonoEnv> = async c => { |
| 41 | let rawBody: unknown; |
nothing calls this directly
no test coverage detected