Skip to content
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

[FR] Return slug when entry is saved from frontend #2792

Closed
menberg opened this issue Apr 23, 2018 · 1 comment
Closed

[FR] Return slug when entry is saved from frontend #2792

menberg opened this issue Apr 23, 2018 · 1 comment
Assignees
Labels
enhancement improvements to existing features site development 👩‍💻 features related to website/API development

Comments

@menberg
Copy link

menberg commented Apr 23, 2018

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

  • Craft version: 3.0.3.1
@brandonkelly brandonkelly self-assigned this Apr 23, 2018
@brandonkelly brandonkelly added enhancement improvements to existing features site development 👩‍💻 features related to website/API development labels Apr 23, 2018
@brandonkelly
Copy link
Member

Added for the next release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement improvements to existing features site development 👩‍💻 features related to website/API development
Projects
None yet
Development

No branches or pull requests

2 participants