From 86bfb4c73eb3697040ecdc548715fe77338a588f Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Thu, 28 May 2020 19:07:28 -0700 Subject: [PATCH] fix(typo): Fixing stat typo error --- src/modules/logapi/controller.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/modules/logapi/controller.js b/src/modules/logapi/controller.js index fd16674..a661330 100644 --- a/src/modules/logapi/controller.js +++ b/src/modules/logapi/controller.js @@ -61,7 +61,7 @@ class LogsApi { const fullPath = _this.generateFileName() // Throw an error if the file does not exist. - fs.sts(fullPath, (err, stat) => { + fs.stat(fullPath, (err, stat) => { if (err) { ctx.body = { success: false, @@ -132,11 +132,10 @@ class LogsApi { generateFileName () { try { const now = new Date() - let thisDate = now.getDate() - thisDate = ('00' + thisDate).slice(-2) + const thisDate = now.getDate() let thisMonth = now.getMonth() + 1 - thisMonth = ('00' + thisMonth).slice(-2) + thisMonth = ('0' + thisMonth).slice(-2) // console.log(`thisMonth: ${thisMonth}`) const thisYear = now.getFullYear()