-
Notifications
You must be signed in to change notification settings - Fork 89
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
feat(blog): expose unique identifier #983
Conversation
Tagging OptionsShould a new tag be published when this PR is merged?
|
return (current as Record<string, T>[]).map((item) => { | ||
const id = (item.name as string).split(path)[1]?.replace("/", ""); | ||
return { | ||
...item[accessor], | ||
id, | ||
}; | ||
}); |
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.
why add it manually? I think this should be in the table, maybe by a workflow that runs it when this changes comes to production
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.
why add it manually? I think this should be in the table, maybe by a workflow that runs it when this changes comes to production
@IncognitaDev, by default it already returns, but in a different format.
ex: collections/blog/categories/05430797e2d1
or collections/blog/posts/1d76260ef8a8
the objective is to do the split and return only the unique identifier to use later
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.
* feat(blog): expose unique identifier * feat(blog): define id prop to optional
What is this Contribution About?
This PR aims to add the unique id of the blog post.
As the post can be 100% edited (including the slug), we added this id to have a unique identifier.
Aiming at a scenario in which we save comments using the post_slug in the comments table, if there were any changes to the slug due to an error or anything else, we would lose all data registered in the system due to this change.
