auto-download images after entity creation
This commit is contained in:
parent
9fb66e731e
commit
d6160d0bae
3 changed files with 6 additions and 0 deletions
|
|
@ -217,6 +217,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const newCharacter = await entityAdapter.createCharacter(payload)
|
const newCharacter = await entityAdapter.createCharacter(payload)
|
||||||
|
// Trigger image download in background (don't await - it queues a job)
|
||||||
|
entityAdapter.downloadCharacterImages(newCharacter.id).catch(console.error)
|
||||||
await goto(`/database/characters/${newCharacter.id}`)
|
await goto(`/database/characters/${newCharacter.id}`)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
saveError = 'Failed to create character. Please try again.'
|
saveError = 'Failed to create character. Please try again.'
|
||||||
|
|
|
||||||
|
|
@ -197,6 +197,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const newSummon = await entityAdapter.createSummon(payload)
|
const newSummon = await entityAdapter.createSummon(payload)
|
||||||
|
// Trigger image download in background (don't await - it queues a job)
|
||||||
|
entityAdapter.downloadSummonImages(newSummon.id).catch(console.error)
|
||||||
await goto(`/database/summons/${newSummon.id}`)
|
await goto(`/database/summons/${newSummon.id}`)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
saveError = 'Failed to create summon. Please try again.'
|
saveError = 'Failed to create summon. Please try again.'
|
||||||
|
|
|
||||||
|
|
@ -204,6 +204,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const newWeapon = await entityAdapter.createWeapon(payload)
|
const newWeapon = await entityAdapter.createWeapon(payload)
|
||||||
|
// Trigger image download in background (don't await - it queues a job)
|
||||||
|
entityAdapter.downloadWeaponImages(newWeapon.id).catch(console.error)
|
||||||
await goto(`/database/weapons/${newWeapon.id}`)
|
await goto(`/database/weapons/${newWeapon.id}`)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
saveError = 'Failed to create weapon. Please try again.'
|
saveError = 'Failed to create weapon. Please try again.'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue