From 740e145d8a1a797449515dc70e7f29f649e61a47 Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Wed, 10 Apr 2024 22:41:34 +1000 Subject: [PATCH] Add `BIGBAGPALLETS` to the search filter in pallets command --- src/commands/mp.ts | 2 +- src/helpers/PalletLibrary.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/mp.ts b/src/commands/mp.ts index a388c9e..47cf47e 100644 --- a/src/commands/mp.ts +++ b/src/commands/mp.ts @@ -101,7 +101,7 @@ export default class MP { pallets: async()=>{ const DSS = await fetchData(client, interaction, choiceSelector) as FSData; if (!DSS) return console.log('Endpoint failed - pallets'); - const filter = DSS?.vehicles.filter(x=>x.category === 'PALLETS'); + const filter = DSS?.vehicles.filter(x=>['PALLETS', 'BIGBAGPALLETS'].includes(x.category)); const rules = { one: 'single pallet', two: 'pallets', diff --git a/src/helpers/PalletLibrary.ts b/src/helpers/PalletLibrary.ts index 4662af7..ad11258 100644 --- a/src/helpers/PalletLibrary.ts +++ b/src/helpers/PalletLibrary.ts @@ -1,7 +1,7 @@ import {FSData} from 'src/interfaces'; export default function(data:FSData) { - const pallets = data.vehicles.filter(x=>x.category === 'PALLETS'); + const pallets = data.vehicles.filter(x=>['PALLETS', 'BIGBAGPALLETS'].includes(x.category)); const counts = pallets.reduce((acc, name)=>{ acc[name.name] = (acc[name.name] ?? 0) + 1; return acc;