mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Change slugs/generate endpoint from GET to POST (#19984)
Followup on feedback on PR #19928 https://github.com/discourse/discourse/pull/19928#discussion_r1083687839, it makes more sense to have this endpoint as a POST rather than a GET.
This commit is contained in:
@@ -159,11 +159,9 @@ export default class CreateChannelController extends Controller.extend(
|
||||
// intentionally not showing AJAX error for this, we will autogenerate
|
||||
// the slug server-side if they leave it blank
|
||||
_generateSlug(name) {
|
||||
ajax("/slugs/generate.json", { type: "GET", data: { name } }).then(
|
||||
(response) => {
|
||||
this.set("autoGeneratedSlug", response.slug);
|
||||
}
|
||||
);
|
||||
ajax("/slugs.json", { type: "POST", data: { name } }).then((response) => {
|
||||
this.set("autoGeneratedSlug", response.slug);
|
||||
});
|
||||
}
|
||||
|
||||
_debouncedGenerateSlug(name) {
|
||||
|
||||
Reference in New Issue
Block a user