mirror of https://github.com/halo-dev/halo
Fix existence query bug again
parent
2933e0297f
commit
4e5694cef0
|
@ -307,10 +307,10 @@ public abstract class BasePostServiceImpl<POST extends BasePost> extends Abstrac
|
||||||
|
|
||||||
if (ServiceUtils.isEmptyId(post.getId())) {
|
if (ServiceUtils.isEmptyId(post.getId())) {
|
||||||
// The sheet will be created
|
// The sheet will be created
|
||||||
exist = basePostRepository.countByUrl(post.getUrl());
|
exist = basePostRepository.existsByUrl(post.getUrl());
|
||||||
} else {
|
} else {
|
||||||
// The sheet will be updated
|
// The sheet will be updated
|
||||||
exist = basePostRepository.countByIdNotAndUrl(post.getId(), post.getUrl());
|
exist = basePostRepository.existsByIdNotAndUrl(post.getId(), post.getUrl());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exist) {
|
if (exist) {
|
||||||
|
|
Loading…
Reference in New Issue