Refactor db and local-cache code

Separated cwmp and ui code into distinct files to enhance clarity and
maintainability with varied internal data representations.
This commit is contained in:
Zaid Humaimidi committed 2023-09-29 14:55:44 -07:00
1 parent 493f1d2f37
commit c3954c277f
31 files changed
+1542 -1530

No files matched your search

+3 -3
View File
@@ -29,9 +29,9 @@ import * as config from "./config";
import api from "./ui/api";
import Authorizer from "./common/authorizer";
import * as logger from "./logger";
import * as localCache from "./local-cache";
import * as localCache from "./ui/local-cache";
import { PermissionSet } from "./types";
import { authLocal } from "./ui/api-functions";
import { authLocal } from "./api-functions";
import * as init from "./init";
import { version as VERSION } from "../package.json";
import memoize from "./common/memoize";
@@ -68,7 +68,7 @@ koa.on("error", (err, ctx) => {
});
koa.use(async (ctx, next) => {
const configSnapshot = await localCache.getCurrentSnapshot();
const configSnapshot = await localCache.getRevision();
ctx.state.configSnapshot = configSnapshot;
ctx.set("X-Config-Snapshot", configSnapshot);
ctx.set("GenieACS-Version", VERSION);