aboutsummaryrefslogtreecommitdiff
path: root/src/api/routes
diff options
context:
space:
mode:
authorPitu <[email protected]>2021-06-17 23:31:48 +0900
committerPitu <[email protected]>2021-06-17 23:31:48 +0900
commitc131c3a1fc3859908d088dcb04d999d7a3368925 (patch)
tree748eb59563d6cdac23ffc88e31cbea715bbadc22 /src/api/routes
parentchore: prevent restarting for the time being (diff)
downloadhost.fuwn.me-c131c3a1fc3859908d088dcb04d999d7a3368925.tar.xz
host.fuwn.me-c131c3a1fc3859908d088dcb04d999d7a3368925.zip
feat: save correct db info
Diffstat (limited to 'src/api/routes')
-rw-r--r--src/api/routes/service/configPOST.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/api/routes/service/configPOST.js b/src/api/routes/service/configPOST.js
index 9129950..68af467 100644
--- a/src/api/routes/service/configPOST.js
+++ b/src/api/routes/service/configPOST.js
@@ -28,7 +28,15 @@ class configGET extends Route {
});
}
- await Util.writeConfigToDb(value);
+ await Util.wipeConfigDb();
+
+ const keys = Object.keys(value);
+ for await (const item of keys) {
+ Util.writeConfigToDb({
+ key: item,
+ value: value[item]
+ });
+ }
return res.status(200).json({ value });
}