mirror of
https://github.com/Akif9748/akf-forum.git
synced 2024-11-22 12:00:41 +03:00
When thread deleted, delete its messages
This commit is contained in:
parent
98675863bb
commit
46d5eac8d8
4 changed files with 8 additions and 7 deletions
|
@ -37,8 +37,8 @@ Akf-forum has got an API for AJAX, other clients etc. And, you can learn about A
|
|||
| Page support, support message limit correct | 🟢 | MEDIUM |
|
||||
| Multi-theme support, black theme | 🟡 | LOW |
|
||||
| Search | 🔴 | MEDIUM |
|
||||
| Footer | 🔴 | LOW |
|
||||
- If thread deleted, not show its messages in API. ?
|
||||
| Footer | 🟢 | LOW |
|
||||
|
||||
- Profile photos will store in database
|
||||
- replacer function global
|
||||
- author name of thread
|
||||
|
@ -50,9 +50,9 @@ Akf-forum has got an API for AJAX, other clients etc. And, you can learn about A
|
|||
- app.param for users in API
|
||||
- message counts for API
|
||||
- ZATEN SİLİNDİ BU KİŞİ & MESAJ
|
||||
- about me button not working
|
||||
- delete thread for threads area
|
||||
- delete admin request, moreover, add it to user patch delete 😳
|
||||
- user -> ips []
|
||||
|
||||
### API
|
||||
| To do | Is done?
|
||||
|
|
|
@ -72,7 +72,7 @@ app.delete("/:id/", async (req, res) => {
|
|||
|
||||
thread.deleted = true;
|
||||
await thread.save();
|
||||
|
||||
await MessageModel.updateMany({ threadID: thread.id }, { deleted: true });
|
||||
res.complate(thread);
|
||||
|
||||
})
|
||||
|
@ -86,6 +86,7 @@ app.post("/:id/undelete", async (req, res) => {
|
|||
thread.edited = true;
|
||||
|
||||
await thread.save();
|
||||
await MessageModel.updateMany({ threadID: thread.id }, { deleted: false });
|
||||
|
||||
res.complate(thread);
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ app.post("/:id/undelete/", async (req, res) => {
|
|||
member.deleted = false;
|
||||
await member.save();
|
||||
|
||||
res.complate(member.toObject({ virtuals: true }));
|
||||
res.complate(member);
|
||||
|
||||
})
|
||||
|
||||
|
@ -74,7 +74,7 @@ app.patch("/:id/", async (req, res) => {
|
|||
|
||||
await member.save();
|
||||
|
||||
res.complate(member.toObject({ virtuals: true }));
|
||||
res.complate(member);
|
||||
|
||||
})
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
body.name = prompt("Enter new username!");
|
||||
else if (e.target.id == "edit_avatar")
|
||||
body.avatar = prompt("Enter new avatar URL!");
|
||||
else if (e.target.id == "edit_avatar")
|
||||
else if (e.target.id == "edit_about")
|
||||
body.about = prompt("Enter new about text!");
|
||||
else return;
|
||||
const res = await request(`/api/users/<%= member.id %>`, "PATCH", body);
|
||||
|
|
Loading…
Reference in a new issue