mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Group pages should work when group name contains periods.
https://meta.discourse.org/t/group-name-cant-have-dot-inside/48658
This commit is contained in:
7
app/assets/javascripts/discourse/adapters/group.js.es6
Normal file
7
app/assets/javascripts/discourse/adapters/group.js.es6
Normal file
@@ -0,0 +1,7 @@
|
||||
import RestAdapter from 'discourse/adapters/rest';
|
||||
|
||||
export default RestAdapter.extend({
|
||||
appendQueryParams(path, findArgs) {
|
||||
return this._super(path, findArgs, '.json');
|
||||
},
|
||||
});
|
||||
@@ -40,7 +40,7 @@ export default Ember.Object.extend({
|
||||
return "/";
|
||||
},
|
||||
|
||||
appendQueryParams(path, findArgs) {
|
||||
appendQueryParams(path, findArgs, extension) {
|
||||
if (findArgs) {
|
||||
if (typeof findArgs === "object") {
|
||||
const queryString = Object.keys(findArgs)
|
||||
@@ -48,11 +48,11 @@ export default Ember.Object.extend({
|
||||
.map(k => k + "=" + encodeURIComponent(findArgs[k]));
|
||||
|
||||
if (queryString.length) {
|
||||
return path + "?" + queryString.join('&');
|
||||
return `${path}${extension ? extension : ''}?${queryString.join('&')}`;
|
||||
}
|
||||
} else {
|
||||
// It's serializable as a string if not an object
|
||||
return path + "/" + findArgs;
|
||||
return `${path}/${findArgs}${extension ? extension : ''}`;
|
||||
}
|
||||
}
|
||||
return path;
|
||||
|
||||
Reference in New Issue
Block a user