Update API routes function pass #2
This commit is contained in:
+7
-3
@@ -2,6 +2,7 @@ import grabRouteParams from "../../utils/grab-route-params";
|
||||
import grabConstants from "../../utils/grab-constants";
|
||||
import grabRouter from "../../utils/grab-router";
|
||||
import isDevelopment from "../../utils/is-development";
|
||||
import _ from "lodash";
|
||||
export default async function ({ req }) {
|
||||
const url = new URL(req.url);
|
||||
const is_dev = isDevelopment();
|
||||
@@ -53,7 +54,10 @@ export default async function ({ req }) {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
return Response.json(res, {
|
||||
...(res.bunext_api_route_res_options || undefined),
|
||||
});
|
||||
if (res) {
|
||||
return Response.json(_.omit(res, "bunext_api_route_res_options"), {
|
||||
...(res.bunext_api_route_res_options || undefined),
|
||||
});
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user