This commit is contained in:
@@ -20,13 +20,13 @@ function initialForm() {
|
||||
if (!editing) {
|
||||
return {
|
||||
name: '', type: 'character', species: '', className: '', level: '', background: '', challengeRating: '',
|
||||
category: 'adventuring-gear', rarity: 'common', quantity: 1, weight: '', properties: '', description: ''
|
||||
category: 'adventuring-gear', rarity: 'common', weight: '', properties: '', description: ''
|
||||
};
|
||||
}
|
||||
return {
|
||||
name: editing.name ?? '', type: 'character', species: '', className: '', level: '', background: '', challengeRating: '',
|
||||
category: editing.category ?? 'adventuring-gear', rarity: editing.rarity ?? 'common',
|
||||
quantity: editing.quantity ?? 1, weight: editing.weight ?? '', properties: editing.properties ?? '',
|
||||
weight: editing.weight ?? '', properties: editing.properties ?? '',
|
||||
description: editing.description ?? ''
|
||||
};
|
||||
}
|
||||
@@ -49,7 +49,7 @@ async function saveEntry() {
|
||||
? { name: form.value.name.trim(), campaign: data.campaign }
|
||||
: { name: form.value.name.trim(), ...(editing ? { id: editing._id } : { campaign: data.campaign }) };
|
||||
if (!isActor) {
|
||||
for (const field of ['category', 'rarity', 'quantity', 'weight', 'properties', 'description']) {
|
||||
for (const field of ['category', 'rarity', 'weight', 'properties', 'description']) {
|
||||
payload[field] = form.value[field];
|
||||
}
|
||||
}
|
||||
@@ -105,10 +105,6 @@ async function saveEntry() {
|
||||
<option value="artifact">{{ $t('campaigns.item.rarities.artifact') }}</option>
|
||||
</select>
|
||||
</label>
|
||||
<label class="form-field">
|
||||
<span>{{ $t('campaigns.item.quantity') }}</span>
|
||||
<input v-model.number="form.quantity" type="number" min="1" required>
|
||||
</label>
|
||||
<label class="form-field">
|
||||
<span>{{ $t('campaigns.item.weight') }}</span>
|
||||
<input v-model="form.weight" type="number" min="0" step="0.1">
|
||||
|
||||
Reference in New Issue
Block a user