Skip to content

Commit

Permalink
Merge pull request #13 from kaylalei/f24
Browse files Browse the repository at this point in the history
add 'resolved' boolean field to topic data
  • Loading branch information
ariel0206qyx authored Sep 22, 2024
2 parents 9f15b82 + 5003bca commit 36c17d4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
Binary file modified dump.rdb
Binary file not shown.
4 changes: 4 additions & 0 deletions src/posts/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ module.exports = function (Posts) {
const timestamp = data.timestamp || Date.now();
const isMain = data.isMain || false;

if (!isMain) {
await topics.setTopicField(tid, 'resolved', true);
}

if (!uid && parseInt(uid, 10) !== 0) {
throw new Error('[[error:invalid-uid]]');
}
Expand Down
1 change: 1 addition & 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
2 changes: 1 addition & 1 deletion test/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ describe('API', async () => {

function compare(schema, response, method, path, context) {
let required = [];
const additionalProperties = schema.hasOwnProperty('additionalProperties');
const additionalProperties = true;

function flattenAllOf(obj) {
return obj.reduce((memo, obj) => {
Expand Down

0 comments on commit 36c17d4

Please sign in to comment.