mirror of https://github.com/status-im/consul.git
Use defaultValue for making sure Name is at least ''
This commit is contained in:
parent
e37136ecae
commit
f87f410e3a
|
@ -7,7 +7,12 @@ export const SLUG_KEY = 'ID';
|
|||
export default Model.extend({
|
||||
[PRIMARY_KEY]: attr('string'),
|
||||
[SLUG_KEY]: attr('string'),
|
||||
Name: attr('string'),
|
||||
Name: attr('string', {
|
||||
// TODO: Why didn't I have to do this for KV's?
|
||||
// this is to ensure that Name is '' and not null when creating
|
||||
// maybe its due to the fact that `Key` is the primaryKey in Kv's
|
||||
defaultValue: '',
|
||||
}),
|
||||
Type: attr('string'),
|
||||
Rules: attr('string'),
|
||||
CreateIndex: attr('number'),
|
||||
|
|
|
@ -13,8 +13,6 @@ export default Route.extend(WithAclActions, {
|
|||
},
|
||||
model: function(params) {
|
||||
this.item = get(this, 'repo').create();
|
||||
// TODO: Why didn't I have to do this for KV's?
|
||||
set(this.item, 'Name', '');
|
||||
set(this.item, 'Datacenter', this.modelFor('dc').dc.Name);
|
||||
return hash({
|
||||
create: true,
|
||||
|
|
Loading…
Reference in New Issue