[feat] Set relationship added and displayed
This commit is contained in:
@@ -10,7 +10,13 @@ export const relations = defineRelations(schema, (r) => ({
|
||||
},
|
||||
cards: {
|
||||
prices: r.many.skus(),
|
||||
set: r.one.sets({
|
||||
from: r.cards.setId,
|
||||
to: r.sets.setId,
|
||||
}),
|
||||
},
|
||||
sets: {
|
||||
cards: r.many.cards(),
|
||||
},
|
||||
|
||||
}));
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ const pokemon = await db.query.cards.findMany({
|
||||
limit: 320,
|
||||
with: {
|
||||
prices: true,
|
||||
set: true,
|
||||
}
|
||||
});
|
||||
|
||||
@@ -42,11 +43,12 @@ const order = ["Near Mint", "Lightly Played", "Moderately Played", "Heavily Play
|
||||
{pokemon.map((card) => (
|
||||
<div class="col">
|
||||
<img src={`/cards/${card.productId}.jpg`} alt={card.productName} class="w-100 img-fluid rounded-4 mb-2" />
|
||||
<div class="col-auto h6 my-0">{card.productName}</div>
|
||||
<div class="h6 my-0">{card.productName}</div>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="copy-small">{card.number}</div>
|
||||
<RarityIcon rarity={card.rarityName} />
|
||||
</div>
|
||||
<div>{card.set?.setName}</div>
|
||||
<div class="row row-cols-5 gx-1 mt-1">
|
||||
{card.prices
|
||||
.slice()
|
||||
|
||||
Reference in New Issue
Block a user