From 01446274d0b73053307c99940c8b006de2c7ab8a Mon Sep 17 00:00:00 2001 From: mrfry Date: Wed, 30 Mar 2022 15:12:13 +0200 Subject: [PATCH] written json format, imagePath rename to mediaPath --- src/modules/api/submodules/forum.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/api/submodules/forum.ts b/src/modules/api/submodules/forum.ts index b9c5a07..373f986 100644 --- a/src/modules/api/submodules/forum.ts +++ b/src/modules/api/submodules/forum.ts @@ -42,7 +42,7 @@ interface ForumEntry { content: string admin: boolean comments: Comment[] - imagePath?: string + mediaPath?: string reacts: { [key: string]: number[] } @@ -346,13 +346,13 @@ function setup(data: SubmoduleData): void { title: title, admin: admins.includes(user.id.toString()), commentCount: 0, - imagePath: image, + mediaPath: image, } contents[newPostKey] = postData utils.WriteFile(JSON.stringify(contents, null, 2), contentFilePath) utils.WriteFile( - JSON.stringify({ ...postData, content: content }), + JSON.stringify({ ...postData, content: content }, null, 2), forumPath + '/' + newPostKey ) @@ -392,7 +392,7 @@ function setup(data: SubmoduleData): void { if (contents[postKey] && contents[postKey].user === user.id) { utils.deleteFile(forumPath + '/' + postKey) delete contents[postKey] - utils.WriteFile(JSON.stringify(contents), contentFilePath) + utils.WriteFile(JSON.stringify(contents, null, 2), contentFilePath) res.json({ success: true, deletedId: postKey }) } else {