diff options
| author | Pitu <[email protected]> | 2021-06-17 23:31:48 +0900 |
|---|---|---|
| committer | Pitu <[email protected]> | 2021-06-17 23:31:48 +0900 |
| commit | c131c3a1fc3859908d088dcb04d999d7a3368925 (patch) | |
| tree | 748eb59563d6cdac23ffc88e31cbea715bbadc22 /src/api/routes | |
| parent | chore: prevent restarting for the time being (diff) | |
| download | host.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.js | 10 |
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 }); } |