Skip to content

monographs: add slug field which regenerates on republish#72

Open
01zulfi wants to merge 5 commits intostreetwriters:masterfrom
01zulfi:monograph/editable-url
Open

monographs: add slug field which regenerates on republish#72
01zulfi wants to merge 5 commits intostreetwriters:masterfrom
01zulfi:monograph/editable-url

Conversation

@01zulfi
Copy link
Contributor

@01zulfi 01zulfi commented Nov 24, 2025

No description provided.

@01zulfi 01zulfi force-pushed the monograph/editable-url branch from 4fe5107 to 7e0e5fa Compare November 25, 2025 06:28
@01zulfi 01zulfi changed the title monographs: allow editable URLs monographs: add slug field which regenerates on update Nov 25, 2025
Comment on lines +238 to +245
if (!string.IsNullOrEmpty(monograph?.Slug))
{
return NotFound(new
{
error = "invalid_id",
error_description = $"No such monograph found."
});
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still contemplating if we need to add this check. On one hand, I think it makes sense to restrict fetching monograph by id if the slug exists. On another hand, if a user's client app is a bit behind (i.e. doesn't have the slug property yet), they'll be shown the monograph link with the id which will be a 404 causing confusion

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we use a different endpoint for monographs with slug? It'll prevent a lot of bugs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The public get monograph API is only called on the monograph frontend. I'm trying to understand how having a separate API to fetch by id and slug is beneficial

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True but if we use separate URL on the frontend for slugs, we can easily route users based on that. It will bring clarity and prevent doing extra work every time a slug is not matched. It still won't fix this though:

On another hand, if a user's client app is a bit behind (i.e. doesn't have the slug property yet), they'll be shown the monograph link with the id which will be a 404 causing confusion

Unless we allow both to work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

created a separate endpoint for getting monographs by slug

also, in the get monography by Id endpoint, I'm not checking for slug anymore

@01zulfi 01zulfi force-pushed the monograph/editable-url branch from 7e0e5fa to 5717b67 Compare November 26, 2025 07:06
@01zulfi 01zulfi changed the title monographs: add slug field which regenerates on update monographs: add slug field which regenerates on republish Dec 22, 2025
@01zulfi 01zulfi force-pushed the monograph/editable-url branch from 56b64a9 to db4a2c8 Compare December 22, 2025 06:32
@01zulfi 01zulfi requested a review from thecodrr December 22, 2025 06:32
@01zulfi 01zulfi force-pushed the monograph/editable-url branch from db4a2c8 to 6904139 Compare February 11, 2026 05:35
Comment on lines +238 to +245
if (!string.IsNullOrEmpty(monograph?.Slug))
{
return NotFound(new
{
error = "invalid_id",
error_description = $"No such monograph found."
});
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we use a different endpoint for monographs with slug? It'll prevent a lot of bugs.

* create separate endpoint for fetching monographs by slug
* combine analytics and publish-url endpoint into a publish-info endpoint
@01zulfi 01zulfi requested a review from thecodrr February 13, 2026 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants