add name EN/JP fields to character detail and edit pages
This commit is contained in:
parent
38b5c4903c
commit
0812e3b2d4
2 changed files with 19 additions and 0 deletions
|
|
@ -78,6 +78,20 @@
|
|||
|
||||
<DetailsContainer title="Metadata">
|
||||
{#if editMode}
|
||||
<DetailItem
|
||||
label="Name (EN)"
|
||||
bind:value={editData.name}
|
||||
editable={true}
|
||||
type="text"
|
||||
placeholder="English name"
|
||||
/>
|
||||
<DetailItem
|
||||
label="Name (JP)"
|
||||
bind:value={editData.nameJp}
|
||||
editable={true}
|
||||
type="text"
|
||||
placeholder="日本語名"
|
||||
/>
|
||||
<SuggestionDetailItem
|
||||
label="Rarity"
|
||||
bind:value={editData.rarity}
|
||||
|
|
@ -143,6 +157,8 @@
|
|||
/>
|
||||
</DetailItem>
|
||||
{:else}
|
||||
<DetailItem label="Name (EN)" value={character.name?.en || '—'} />
|
||||
<DetailItem label="Name (JP)" value={character.name?.ja || '—'} />
|
||||
<DetailItem label="Rarity" value={getRarityLabel(character.rarity)} />
|
||||
<DetailItem label="Granblue ID">
|
||||
{#if character.granblueId}
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@
|
|||
// Editable fields - initialized from character data
|
||||
let editData = $state({
|
||||
name: '',
|
||||
nameJp: '',
|
||||
granblueId: '',
|
||||
characterId: '', // Comma-separated string for dual/trio units
|
||||
rarity: 1,
|
||||
|
|
@ -126,6 +127,7 @@
|
|||
if (character) {
|
||||
editData = {
|
||||
name: character.name?.en || '',
|
||||
nameJp: character.name?.ja || '',
|
||||
granblueId: character.granblueId || '',
|
||||
characterId: character.characterId?.join(', ') || '',
|
||||
rarity: character.rarity || 1,
|
||||
|
|
@ -183,6 +185,7 @@
|
|||
// Prepare the data for API (flat snake_case format)
|
||||
const payload = {
|
||||
name_en: editData.name,
|
||||
name_jp: editData.nameJp,
|
||||
granblue_id: editData.granblueId,
|
||||
character_id:
|
||||
editData.characterId.trim() === ''
|
||||
|
|
|
|||
Loading…
Reference in a new issue