[FR] Return slug when entry is saved from frontend #2792
Labels
enhancement
improvements to existing features
site development 👩💻
features related to website/API development
Description
When submitting entries from the frontend via HTTP POST requests, Craft returns properties like id, title and authorUsername as JSON, but not slug.
To redirect the author to the newly saved entry, we need to have the slug of the entry. Right now, it's necessary to send an additional request to Craft to get the slug of the entry.
Would it be possible to add slug to the returned properties after submitting entries via POST requests?
Steps to solve
Add
$return['slug'] = $entry->slug;
over here:https://github.com/craftcms/cms/blob/develop/src/controllers/EntriesController.php#L565
Additional info
The text was updated successfully, but these errors were encountered: