[feat] implemented product variants
This commit is contained in:
@@ -23,6 +23,7 @@ async function createCollection(client: Client) {
|
||||
name: 'cards',
|
||||
fields: [
|
||||
{ name: 'productId', type: 'int32' },
|
||||
{ name: 'variant', type: 'string' },
|
||||
{ name: 'productName', type: 'string' },
|
||||
{ name: 'productLineName', type: 'string', facet: true },
|
||||
{ name: 'rarityName', type: 'string', facet: true },
|
||||
@@ -33,7 +34,7 @@ async function createCollection(client: Client) {
|
||||
{ name: 'Artist', type: 'string' },
|
||||
{ name: 'sealed', type: 'bool' },
|
||||
],
|
||||
default_sorting_field: 'productId',
|
||||
//default_sorting_field: 'productId',
|
||||
});
|
||||
console.log(chalk.green('Collection "cards" created successfully.'));
|
||||
} else {
|
||||
@@ -54,6 +55,7 @@ async function preloadSearchIndex() {
|
||||
|
||||
await client.collections('cards').documents().import(pokemon.map(card => ({
|
||||
productId: card.productId,
|
||||
variant: card.variant,
|
||||
productName: card.productName,
|
||||
productLineName: card.productLineName,
|
||||
rarityName: card.rarityName,
|
||||
|
||||
Reference in New Issue
Block a user