Add default value for type in mirage

This commit is contained in:
Carlos Alcaide Corvo committed 2022-01-27 11:36:29 -08:00
1 parent da1056d222
commit e150b15f00
2 files changed
+4

No files matched your search

+3
View File
@@ -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(),