yazid138 2 years ago
parent
commit
c8a18d55ae
1 changed files with 1 additions and 1 deletions
  1. 1 1
      controller/auto.controller.js

+ 1 - 1
controller/auto.controller.js

@@ -393,7 +393,7 @@ exports.backup = handleError(async (req, res) => {
     (async () => {
       const path = 'backup/' + new Date().getTime() + '-chunk.json'
       const chunk = await chunkModel.find().lean()
-      fs.writeFileSync(path, chunk)
+      fs.writeFileSync(path, JSON.stringify(chunk))
       // const { size } = fs.statSync(path)
       // const mimetype = 'application/json'
       // const buffer = fs.readFileSync(path)