2019-10-23 12:39:32 -04:00
|
|
|
import Route from "@ember/routing/route";
|
2023-08-25 08:21:38 -04:00
|
|
|
import { inject as service } from "@ember/service";
|
2023-10-10 14:38:59 -04:00
|
|
|
import { disableImplicitInjections } from "discourse/lib/implicit-injections";
|
2019-03-18 16:09:13 -04:00
|
|
|
|
2023-09-14 06:27:09 -04:00
|
|
|
@disableImplicitInjections
|
2023-03-15 09:17:51 -04:00
|
|
|
export default class AdminSiteTextIndexRoute extends Route {
|
2023-09-14 06:27:09 -04:00
|
|
|
@service siteSettings;
|
|
|
|
@service store;
|
2023-08-25 08:21:38 -04:00
|
|
|
|
2023-03-15 09:17:51 -04:00
|
|
|
queryParams = {
|
2015-11-30 15:22:58 -05:00
|
|
|
q: { replace: true },
|
|
|
|
overridden: { replace: true },
|
2023-07-09 22:06:40 -04:00
|
|
|
outdated: { replace: true },
|
2021-01-18 12:53:45 -05:00
|
|
|
locale: { replace: true },
|
2023-03-15 09:17:51 -04:00
|
|
|
};
|
2015-11-23 16:45:05 -05:00
|
|
|
|
|
|
|
model(params) {
|
2023-09-14 06:27:09 -04: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 09:17:51 -04:00
|
|
|
}
|
|
|
|
}
|