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