fix: correct function signatures and remove redundant code
- DatabaseProvider.ts: Remove redundant normalizer check - Normalizer is applied by parent class, no need to apply twice - Fixes "Property 'normalizer' does not exist" error - image.ts: Separate type and value exports for proper type resolution - CharacterImageCell.svelte: Fix getCharacterImage parameter order - Changed (id, pose, variant) to (id, variant, pose) - SearchContent.svelte: Fix getCharacterImage parameter order Fixes ImageVariant type errors and property access errors. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
b54ac91638
commit
16e24e337b
4 changed files with 4 additions and 9 deletions
|
|
@ -12,7 +12,7 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="image-cell">
|
<div class="image-cell">
|
||||||
<img src={getCharacterImage(row.granblueId, '01', 'square')} alt="" class="database-image" />
|
<img src={getCharacterImage(row.granblueId, 'square', '01')} alt="" class="database-image" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,7 @@
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'character':
|
case 'character':
|
||||||
return getCharacterImage(id, '01', 'square')
|
return getCharacterImage(id, 'square', '01')
|
||||||
case 'weapon':
|
case 'weapon':
|
||||||
return getWeaponImage(id, 'square')
|
return getWeaponImage(id, 'square')
|
||||||
case 'summon':
|
case 'summon':
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
// Re-export types and functions from the main image utility
|
// Re-export types and functions from the main image utility
|
||||||
export {
|
export {
|
||||||
type ResourceType as ResourceKind,
|
|
||||||
type ImageVariant,
|
|
||||||
getPlaceholderImage as getPlaceholder,
|
getPlaceholderImage as getPlaceholder,
|
||||||
getCharacterImage,
|
getCharacterImage,
|
||||||
getWeaponImage,
|
getWeaponImage,
|
||||||
|
|
@ -9,6 +7,8 @@ export {
|
||||||
getImageUrl as getImageUrlBase
|
getImageUrl as getImageUrlBase
|
||||||
} from '$lib/utils/images'
|
} from '$lib/utils/images'
|
||||||
|
|
||||||
|
export type { ResourceType as ResourceKind, ImageVariant } from '$lib/utils/images'
|
||||||
|
|
||||||
// Legacy compatibility wrapper
|
// Legacy compatibility wrapper
|
||||||
interface ImageArgs {
|
interface ImageArgs {
|
||||||
type: 'character' | 'weapon' | 'summon'
|
type: 'character' | 'weapon' | 'summon'
|
||||||
|
|
|
||||||
|
|
@ -80,11 +80,6 @@ export class DatabaseProvider extends RestDataProvider {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply normalizer if defined
|
|
||||||
if (this.normalizer && result.results) {
|
|
||||||
return result.results.map(this.normalizer)
|
|
||||||
}
|
|
||||||
|
|
||||||
return result.results || []
|
return result.results || []
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to fetch data:', error)
|
console.error('Failed to fetch data:', error)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue