-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exclude hidden links from get all links #73
base: develop
Are you sure you want to change the base?
Exclude hidden links from get all links #73
Conversation
query.addCriteria(Criteria.where("hidden").is(false)); | ||
List<Link> result = mongoTemplate.find(query, Link.class, mongoCollectionName); | ||
log.info("Found {} active links in database", result); | ||
return result; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i doubt that this is a good idea to apply filters to getAllLinks() method at repository level.
what about a new one like getAllNotHiddenLinks or anything similar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly. Thanks
private String url; | ||
|
||
@ApiModelProperty(value = "Flag that means link is hidden or active") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'd remove final part "or active". if you want to use it as a substitute for "not hidden", there are a lot of more evident words like open, public, visible, apparent so on. but as for me its better to use a simple negation: "Flag that means the link is hidden or not".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right
…n-links-from-get-all-links # Conflicts: # links/src/main/java/juja/microservices/links/config/CorsConfig.java # links/src/main/java/juja/microservices/links/controller/LinksController.java # links/src/main/java/juja/microservices/links/model/Link.java # links/src/main/java/juja/microservices/links/model/SaveLinkRequest.java # links/src/main/java/juja/microservices/links/repository/impl/LinksRepositoryImpl.java # links/src/test/java/juja/microservices/links/controller/LinksControllerTest.java # links/src/test/java/juja/microservices/links/service/LinksServiceTest.java
"hidden".ne(true) obtain links without "hidden" fields we suppose that links without "hidden" field are equals links with hidden default value 'false'
close #62 or issue #49