Disabled fires render
This commit is contained in:
parent
cb7aeda4b8
commit
8b598fab7c
1 changed files with 16 additions and 12 deletions
|
|
@ -4,6 +4,8 @@
|
|||
import Fires from '/imports/api/Fires/Fires';
|
||||
// import Comments from '/imports/api/Comments/Comments';
|
||||
|
||||
const firesMapEnabled = false;
|
||||
|
||||
sitemaps.add('/sitemap.xml', () => {
|
||||
const today = new Date();
|
||||
|
||||
|
|
@ -27,6 +29,7 @@ sitemaps.add('/sitemap.xml', () => {
|
|||
});
|
||||
}); */
|
||||
|
||||
if (firesMapEnabled) {
|
||||
Fires.find({}, { limit: 100, sort: { createdAt: -1 } }).fetch().forEach((fire) => {
|
||||
// Search the last comment of tha fire
|
||||
const lastComment = Comments.getCollection().findOne({ referenceId: `fire-${fire._id}` }, { sort: { createdAt: -1 } });
|
||||
|
|
@ -35,6 +38,7 @@ sitemaps.add('/sitemap.xml', () => {
|
|||
lastmod: lastComment ? lastComment.createdAt : fire.updatedAt
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return out;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue