Add default value for type in mirage
This commit is contained in:
1 parent
da1056d222
commit
e150b15f00
2 files changed
+4
No files matched your search
@@ -10,6 +10,9 @@ export default factory.extend({
|
||||
'delete',
|
||||
],
|
||||
id: (i) => `host-id-${i}`,
|
||||
type() {
|
||||
return this.hostCatalog?.type || factory.attrs.type;
|
||||
},
|
||||
plugin() {
|
||||
if (this.type === 'plugin') {
|
||||
return this.hostCatalog.plugin;
|
||||
|
||||
@@ -5,6 +5,7 @@ import { random, date, internet, datatype } from 'faker';
|
||||
* GeneratedHostModelFactory
|
||||
*/
|
||||
export default Factory.extend({
|
||||
type: 'static',
|
||||
name: () => random.words(),
|
||||
description: () => random.words(),
|
||||
created_time: () => date.recent(),
|
||||
|
||||
Reference in new issue
Block a user