Skip to content

Commit

Permalink
build
Browse files Browse the repository at this point in the history
  • Loading branch information
Xziy committed Oct 2, 2024
1 parent 1cd5256 commit 9ee39ee
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion models/Group.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,13 @@ let Model = {
async getGroupBySlug(groupSlug) {
if (!groupSlug)
throw "groupSlug is required";
const groupObj = await Group.findOne({ slug: groupSlug });
let groupObj;
if (process.env.UNIQUE_SLUG) {
groupObj = await Group.findOne({ slug: groupSlug });
}
else {
groupObj = await Group.find({ slug: groupSlug, isDeleted: false, visible: true });
}
if (!groupObj) {
throw "group with slug " + groupSlug + " not found";
}
Expand Down

0 comments on commit 9ee39ee

Please sign in to comment.