mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 22:08:33 +08:00
21 lines
452 B
Plaintext
21 lines
452 B
Plaintext
|
import RestAdapter from 'discourse/adapters/rest';
|
||
|
|
||
|
export default RestAdapter.extend({
|
||
|
basePath() {
|
||
|
return "/admin/";
|
||
|
},
|
||
|
|
||
|
afterFindAll(results) {
|
||
|
let map = {};
|
||
|
results.forEach(theme => {map[theme.id] = theme;});
|
||
|
results.forEach(theme => {
|
||
|
let mapped = theme.get("child_themes") || [];
|
||
|
mapped = mapped.map(t => map[t.id]);
|
||
|
theme.set("childThemes", mapped);
|
||
|
});
|
||
|
return results;
|
||
|
},
|
||
|
|
||
|
jsonMode: true
|
||
|
});
|