mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: handle permalinks with query parameters (#12700)
This commit is contained in:
parent
6a7a8f32f1
commit
c1fc2a1e9b
@ -3,8 +3,9 @@ import DiscourseURL from "discourse/lib/url";
|
|||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
|
|
||||||
export default DiscourseRoute.extend({
|
export default DiscourseRoute.extend({
|
||||||
model(params, transition) {
|
model(_, transition) {
|
||||||
const path = params.path;
|
const path = transition.intent.url;
|
||||||
|
|
||||||
return ajax("/permalink-check.json", {
|
return ajax("/permalink-check.json", {
|
||||||
data: { path },
|
data: { path },
|
||||||
}).then((results) => {
|
}).then((results) => {
|
||||||
|
@ -26,8 +26,8 @@ acceptance("Category 404", function (needs) {
|
|||||||
|
|
||||||
acceptance("Unknown", function (needs) {
|
acceptance("Unknown", function (needs) {
|
||||||
const urls = {
|
const urls = {
|
||||||
"viewtopic.php": "/t/internationalization-localization/280",
|
"/viewtopic.php?f=8&t=280": "/t/internationalization-localization/280",
|
||||||
"not-the-url-for-faq": "/faq",
|
"/another-url-for-faq": "/faq",
|
||||||
};
|
};
|
||||||
|
|
||||||
needs.pretender((server, helper) => {
|
needs.pretender((server, helper) => {
|
||||||
@ -59,7 +59,7 @@ acceptance("Unknown", function (needs) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("Permalink URL to a static page", async function (assert) {
|
test("Permalink URL to a static page", async function (assert) {
|
||||||
await visit("/not-the-url-for-faq");
|
await visit("/another-url-for-faq");
|
||||||
assert.equal(currentURL(), "/faq");
|
assert.equal(currentURL(), "/faq");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user