fix(model): 🐛 wrong definition for static method create
This commit is contained in:
parent
5ecebbec14
commit
3e3fd59fe7
|
@ -13,11 +13,23 @@ export class Machine extends Ressource {
|
||||||
}
|
}
|
||||||
|
|
||||||
static create(
|
static create(
|
||||||
{ tags, url, status, groups, ...props }:
|
{ tags, url, status, groups, avatar }: Pick<
|
||||||
& Pick<Machine, 'tags' | 'url' | 'status' | 'avatar' | 'groups'>
|
Machine,
|
||||||
& Pick<Ressource, 'name' | 'uuid' | 'avatar' | 'createdAt' | 'updatedAt'>,
|
'name' | 'tags' | 'url' | 'status' | 'avatar' | 'groups'
|
||||||
|
>,
|
||||||
): Machine {
|
): Machine {
|
||||||
return new Machine({ ...props, tags, url, status, groups })
|
const { uuid, createdAt, updatedAt } = super.create({ name, avatar })
|
||||||
|
return new Machine({
|
||||||
|
uuid,
|
||||||
|
createdAt,
|
||||||
|
updatedAt,
|
||||||
|
avatar,
|
||||||
|
name,
|
||||||
|
tags,
|
||||||
|
url,
|
||||||
|
status,
|
||||||
|
groups,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#tags: readonly string[]
|
#tags: readonly string[]
|
||||||
|
|
Loading…
Reference in a new issue