2019-10-24 00:39:32 +08:00
|
|
|
import Route from "@ember/routing/route";
|
2023-08-25 20:21:38 +08:00
|
|
|
import { inject as service } from "@ember/service";
|
2023-10-11 02:38:59 +08:00
|
|
|
import { disableImplicitInjections } from "discourse/lib/implicit-injections";
|
2019-03-19 04:09:13 +08:00
|
|
|
|
2023-09-14 18:27:09 +08:00
|
|
|
@disableImplicitInjections
|
2023-03-15 21:17:51 +08:00
|
|
|
export default class AdminSiteTextIndexRoute extends Route {
|
2023-09-14 18:27:09 +08:00
|
|
|
@service siteSettings;
|
|
|
|
@service store;
|
2023-08-25 20:21:38 +08:00
|
|
|
|
2023-03-15 21:17:51 +08:00
|
|
|
queryParams = {
|
2015-12-01 04:22:58 +08:00
|
|
|
q: { replace: true },
|
|
|
|
overridden: { replace: true },
|
2023-07-10 10:06:40 +08:00
|
|
|
outdated: { replace: true },
|
2021-01-19 01:53:45 +08:00
|
|
|
locale: { replace: true },
|
2023-03-15 21:17:51 +08:00
|
|
|
};
|
2015-11-24 05:45:05 +08:00
|
|
|
|
|
|
|
model(params) {
|
2023-09-14 18:27:09 +08:00
|
|
|
return this.store.find("site-text", {
|
|
|
|
q: params.q,
|
|
|
|
overridden: params.overridden ?? false,
|
|
|
|
outdated: params.outdated ?? false,
|
|
|
|
locale: params.locale ?? this.siteSettings.default_locale,
|
|
|
|
});
|
2023-03-15 21:17:51 +08:00
|
|
|
}
|
|
|
|
}
|