mirror of
https://github.com/discourse/discourse.git
synced 2024-12-27 12:00:03 +08:00
21 lines
474 B
JavaScript
21 lines
474 B
JavaScript
|
import { service } from "@ember/service";
|
||
|
import DiscourseRoute from "discourse/routes/discourse";
|
||
|
import { i18n } from "discourse-i18n";
|
||
|
|
||
|
const DEFAULT_VALUES = {
|
||
|
field_type: "text",
|
||
|
requirement: "optional",
|
||
|
};
|
||
|
|
||
|
export default class AdminUserFieldsNewRoute extends DiscourseRoute {
|
||
|
@service store;
|
||
|
|
||
|
async model() {
|
||
|
return this.store.createRecord("user-field", { ...DEFAULT_VALUES });
|
||
|
}
|
||
|
|
||
|
titleToken() {
|
||
|
return i18n("admin.user_fields.new_header");
|
||
|
}
|
||
|
}
|