Skip to content
This repository was archived by the owner on Jun 27, 2019. It is now read-only.

Commit 5fe9292

Browse files
fixed create-slug hook
1 parent aa3e1d3 commit 5fe9292

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

server/helper/get-unique-slug.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ const getUniqueSlug = (service, slug, count, id) => {
1313
};
1414
}
1515
service.find({
16-
query
16+
query,
17+
_populate: 'skip'
1718
}).then((result) => {
1819
if (result.data.length > 0) {
1920
count = count ? count + 1 : 1;

server/hooks/create-slug.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = function (options = { field: null, overwrite: false, unique: tr
1616
const titleSlug = slug(hook.data[options.field], {
1717
lower: true
1818
});
19-
if (options.unique) {
19+
if (options.unique !== false) {
2020
getUniqueSlug(hook.service, titleSlug, null, hook.id)
2121
.then((uniqueSlug) => {
2222
hook.data.slug = uniqueSlug;

0 commit comments

Comments
 (0)