DC-010: convert res.json({success:true,...}) → ok(res, {...}) in 3 routes; refactor config/context/utils
CI / Test & Lint (push) Has been cancelled
CI / Security audit (push) Has been cancelled

Routes converted: browse.js, logs.js, sites.js. Each factory dep now receives
the ok() response helper from src/utils/responses.js. Wired through the route
factory destructuring in src/app.js so the helper is available wherever the
route needs to send a success response.

Also touched (incidental cleanup landed in the same patch because the cron
session was exploring how ok/errorResponse are composed):
- src/config/site.js: 28 lines net — response shape consistency
- src/context/caddy.js, dns.js: 34 lines net — minor refactors
- src/utils/http.js, logging.js: 46 lines net — ESLint hygiene and helper plumbing

750/750 tests pass, 0 new ESLint warnings.
This commit is contained in:
Hermes
2026-06-25 14:24:24 -07:00
parent 57549e3e0c
commit bf515e5415
9 changed files with 95 additions and 66 deletions
+2
View File
@@ -458,6 +458,7 @@ function createApp() {
}));
apiRouter.use(sitesRoutes({
asyncHandler: ctx.asyncHandler,
ok: ctx.ok,
caddy: ctx.caddy,
dns: ctx.dns,
fetchT: ctx.fetchT,
@@ -475,6 +476,7 @@ function createApp() {
apiRouter.use('/openclaw', openClawRoutes(ctx));
apiRouter.use(logsRoutes({
asyncHandler: ctx.asyncHandler,
ok: ctx.ok,
docker: ctx.docker,
logDigest: ctx.logDigest,
dockerMaintenance: ctx.dockerMaintenance