Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #175 from B77Mills/hasWebsiteSchedule
Browse files Browse the repository at this point in the history
  • Loading branch information
zarathustra323 authored Oct 28, 2021
2 parents 1ade4b7 + aa50c71 commit f4536a1
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const loadSection = async ({
siteId,
id,
alias,
strict = true,
}) => {
if (!id && !alias) return null;
const sectionQuery = {
Expand All @@ -81,7 +82,9 @@ const loadSection = async ({
} else {
sectionQuery._id = id;
}
return basedb.strictFindOne('website.Section', sectionQuery, { projection: { _id: 1 } });
return strict
? basedb.strictFindOne('website.Section', sectionQuery, { projection: { _id: 1 } })
: basedb.findOne('website.Section', sectionQuery, { projection: { _id: 1 } });
};

const loadOptions = async ({
Expand Down Expand Up @@ -607,6 +610,7 @@ module.exports = {
siteId,
id: sectionId,
alias: sectionAlias,
strict: false,
}),
loadOptions({
basedb,
Expand All @@ -615,6 +619,7 @@ module.exports = {
names: optionName.length ? optionName : ['Standard'],
}),
]);
if (!section) return false;

const descendantIds = sectionBubbling ? await getDescendantIds(section._id, basedb) : [];

Expand Down

0 comments on commit f4536a1

Please sign in to comment.