Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added data model and schema to store resolved status as a boolean for topics #24

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .mocharc.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
reporter: dot
timeout: 25000
exit: true
bail: true
bail: false
Binary file modified dump.rdb
Binary file not shown.
4 changes: 4 additions & 0 deletions public/openapi/components/schemas/TopicObject.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ TopicObject:
properties:
lastposttime:
type: number
resolved:
type: boolean
description: Indicates whether the topic is marked as solved or unsolved.
example: false
category:
type: object
properties:
Expand Down
2 changes: 2 additions & 0 deletions src/topics/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ module.exports = function (Topics) {
lastposttime: 0,
postcount: 0,
viewcount: 0,
resolved: false,
};

if (Array.isArray(data.tags) && data.tags.length) {
Expand Down Expand Up @@ -244,6 +245,7 @@ module.exports = function (Topics) {
posts.overrideGuestHandle(postData, data.handle);

postData.votes = 0;
postData.resolved = false;
postData.bookmarked = false;
postData.display_edit_tools = true;
postData.display_delete_tools = true;
Expand Down
Loading