diff --git a/src/app/components/characters/character-dashboard/character-dashboard.component.html b/src/app/components/characters/character-dashboard/character-dashboard.component.html index c207311..8b2e29c 100644 --- a/src/app/components/characters/character-dashboard/character-dashboard.component.html +++ b/src/app/components/characters/character-dashboard/character-dashboard.component.html @@ -1,6 +1,8 @@ {{ character().name }} - {{ character().age }}, {{ character().gender }}, {{ character().nation }} , {{ character().religion }} + Level {{ character().level }} - {{ character().age }}, {{ character().gender }}, {{ character().nation }} , {{ character().religion }} +
diff --git a/src/app/models/character/character.entity.ts b/src/app/models/character/character.entity.ts index 7cddaf6..cd39ed7 100644 --- a/src/app/models/character/character.entity.ts +++ b/src/app/models/character/character.entity.ts @@ -4,6 +4,7 @@ import { Statistics } from './statistics'; export interface CharacterEntity extends Statistics { id: number; + level: number; name: string; gender: string; nation: string; diff --git a/src/app/services/characters.service.ts b/src/app/services/characters.service.ts index 3d271c2..b339636 100644 --- a/src/app/services/characters.service.ts +++ b/src/app/services/characters.service.ts @@ -41,9 +41,10 @@ export class CharactersService { ); } - async add(character: Omit): Promise { + async add(character: Omit): Promise { const characterEntity = await this.charactersTable.add({ ...character, + level: 1, value: { life: 0, power: 0, diff --git a/src/app/stores/characters.store.ts b/src/app/stores/characters.store.ts index 6f229e2..0a59907 100644 --- a/src/app/stores/characters.store.ts +++ b/src/app/stores/characters.store.ts @@ -16,7 +16,7 @@ export const CharactersStore = signalStore( const characters = await charactersService.list(); patchState(store, setAllEntities(characters)); }, - add: async (character: Omit) => { + add: async (character: Omit) => { const newCharacter = await charactersService.add(character); patchState(store, addEntity(newCharacter));