Skip to content
This repository has been archived by the owner on Jan 5, 2021. It is now read-only.

Commit

Permalink
♻️ Don't overwrite slugs
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Sep 28, 2020
1 parent 8cab75c commit 0999e8e
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion api/blog-category/models/blog-category.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = {
}
},
beforeUpdate: async (_, data) => {
data.slug = slugify(data.title);
data.slug = data.slug || slugify(data.title);
},
},
};
2 changes: 1 addition & 1 deletion api/blog-post/models/blog-post.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = {
}
},
beforeUpdate: async (_, data) => {
data.slug = slugify(data.title);
data.slug = data.slug || slugify(data.title);
},
},
};
2 changes: 1 addition & 1 deletion api/jobs/models/jobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = {
}
},
beforeUpdate: async (_, data) => {
data.slug = slugify(data.title);
data.slug = data.slug || slugify(data.title);
},
},
};
2 changes: 1 addition & 1 deletion api/policies/models/policies.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = {
}
},
beforeUpdate: async (_, data) => {
data.slug = slugify(data.title);
data.slug = data.slug || slugify(data.title);
},
},
};
2 changes: 1 addition & 1 deletion api/team-member/models/team-member.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = {
}
},
beforeUpdate: async (_, data) => {
data.slug = slugify(data.title);
data.slug = data.slug || slugify(data.title);
},
},
};

0 comments on commit 0999e8e

Please sign in to comment.