fix(model): 🐛 wrong definition for static method create

This commit is contained in:
Julien Oculi 2024-06-18 13:52:24 +02:00
parent 5ecebbec14
commit 3e3fd59fe7

View file

@ -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[]