integrating change from Sites

master
rob 2 years ago
parent c60ebae152
commit 43cd9b04ed

@ -253,6 +253,23 @@ class CommentService extends SiteService {
}
return fullComment.contentHistory || [ ];
}
/**
* Deletes all comments filed against a given resource.
* @param {Resource} resource The resource for which all comments are to be
* deleted (physically removed from database).
*/
async deleteForResource (resource) {
const { contentReport: contentReportService } = this.dtp.services;
this.log.info('deleting all comments for resource', { resourceId: resource._id });
await Comment
.find({ resource: resource._id })
.cursor()
.eachAsync(async (comment) => {
await contentReportService.removeForResource(comment);
await Comment.deleteOne({ _id: comment._id });
}, 4);
}
}
module.exports = {

@ -1,5 +1,6 @@
extends main
block content-container
block content-header
section.uk-section.uk-section-default
.uk-container
div(uk-grid)#dtp-content-grid

@ -52,7 +52,7 @@ html(lang='en')
}
}
body.dtp(class= 'dtp-dark', data-dtp-env= process.env.NODE_ENV, data-dtp-domain= site.domainKey, data-current-view= currentView)
body.dtp(class= user ? user.theme : 'dtp-light', data-dtp-env= process.env.NODE_ENV, data-dtp-domain= site.domainKey, data-current-view= currentView)
include ../components/site-link

@ -75,7 +75,7 @@
"striptags": "^3.2.0",
"svg-captcha": "^1.4.0",
"systeminformation": "^5.11.6",
"tinymce": "^6.0.0",
"tinymce": "^6.1.0",
"uikit": "^3.11.1",
"uniqid": "^5.4.0",
"url-validation": "^2.1.0",

@ -8188,10 +8188,10 @@ tiny-inflate@^1.0.2:
resolved "https://registry.yarnpkg.com/tiny-inflate/-/tiny-inflate-1.0.3.tgz#122715494913a1805166aaf7c93467933eea26c4"
integrity sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw==
tinymce@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/tinymce/-/tinymce-6.0.0.tgz#44945e4c12ea90d08aedf357304c24269a164e54"
integrity sha512-y4b5OhxScZiFovTgEFzI+2zEDSMfbJSQ4hfcYPg9HXvudxvDIHjc3fF73m0Sys5h8YtpWPG1fT9iJsjSnwuo2A==
tinymce@^6.1.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/tinymce/-/tinymce-6.1.0.tgz#a5e13307646f2e6e1fd2923dcb664647afe3a93c"
integrity sha512-IdSdMlmuyhpEpUuabhBUaRC2NzZZxP2/CO/F+/54kTaAifB1Et5mKEty03pJYZxl6GBdFgclKRA2UU5JKJtJbA==
to-absolute-glob@^2.0.0:
version "2.0.2"

Loading…
Cancel
Save