mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
written json format, imagePath rename to mediaPath
This commit is contained in:
parent
07b313bcd9
commit
01446274d0
1 changed files with 4 additions and 4 deletions
|
@ -42,7 +42,7 @@ interface ForumEntry {
|
||||||
content: string
|
content: string
|
||||||
admin: boolean
|
admin: boolean
|
||||||
comments: Comment[]
|
comments: Comment[]
|
||||||
imagePath?: string
|
mediaPath?: string
|
||||||
reacts: {
|
reacts: {
|
||||||
[key: string]: number[]
|
[key: string]: number[]
|
||||||
}
|
}
|
||||||
|
@ -346,13 +346,13 @@ function setup(data: SubmoduleData): void {
|
||||||
title: title,
|
title: title,
|
||||||
admin: admins.includes(user.id.toString()),
|
admin: admins.includes(user.id.toString()),
|
||||||
commentCount: 0,
|
commentCount: 0,
|
||||||
imagePath: image,
|
mediaPath: image,
|
||||||
}
|
}
|
||||||
|
|
||||||
contents[newPostKey] = postData
|
contents[newPostKey] = postData
|
||||||
utils.WriteFile(JSON.stringify(contents, null, 2), contentFilePath)
|
utils.WriteFile(JSON.stringify(contents, null, 2), contentFilePath)
|
||||||
utils.WriteFile(
|
utils.WriteFile(
|
||||||
JSON.stringify({ ...postData, content: content }),
|
JSON.stringify({ ...postData, content: content }, null, 2),
|
||||||
forumPath + '/' + newPostKey
|
forumPath + '/' + newPostKey
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -392,7 +392,7 @@ function setup(data: SubmoduleData): void {
|
||||||
if (contents[postKey] && contents[postKey].user === user.id) {
|
if (contents[postKey] && contents[postKey].user === user.id) {
|
||||||
utils.deleteFile(forumPath + '/' + postKey)
|
utils.deleteFile(forumPath + '/' + postKey)
|
||||||
delete contents[postKey]
|
delete contents[postKey]
|
||||||
utils.WriteFile(JSON.stringify(contents), contentFilePath)
|
utils.WriteFile(JSON.stringify(contents, null, 2), contentFilePath)
|
||||||
|
|
||||||
res.json({ success: true, deletedId: postKey })
|
res.json({ success: true, deletedId: postKey })
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue