@rpcbase/api 0.147.0 → 0.148.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -27384,7 +27384,7 @@ var initApi = async ({ app, routes, cors: corsOptions }) => {
27384
27384
  const registerHandler = (method, path, handler) => {
27385
27385
  assert(path.startsWith("/api"), "API routes must start with /api");
27386
27386
  app[method](path, async (req, res, next) => {
27387
- const payload = req.body || {};
27387
+ const payload = method === "get" ? req.query : req.body ?? {};
27388
27388
  try {
27389
27389
  const result = await handler(payload, {
27390
27390
  req,