Move (re)creation of stats to its own function

This commit is contained in:
valadaptive
2023-12-07 10:04:32 -05:00
parent e9a49b7997
commit d6f5e63d85
2 changed files with 16 additions and 10 deletions

View File

@ -804,7 +804,7 @@ app.post('/getstats', jsonParser, function (request, response) {
*/
app.post('/recreatestats', jsonParser, async function (request, response) {
try {
await statsHelpers.loadStatsFile(DIRECTORIES.chats, DIRECTORIES.characters, true);
await statsHelpers.recreateStats(DIRECTORIES.chats, DIRECTORIES.characters);
return response.sendStatus(200);
} catch (error) {
console.error(error);