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(
|
||||
{ tags, url, status, groups, ...props }:
|
||||
& Pick<Machine, 'tags' | 'url' | 'status' | 'avatar' | 'groups'>
|
||||
& Pick<Ressource, 'name' | 'uuid' | 'avatar' | 'createdAt' | 'updatedAt'>,
|
||||
{ tags, url, status, groups, avatar }: Pick<
|
||||
Machine,
|
||||
'name' | 'tags' | 'url' | 'status' | 'avatar' | 'groups'
|
||||
>,
|
||||
): 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[]
|
||||
|
|
Loading…
Reference in a new issue