From 004c9cf5f0361b59bb08d74e696bfd76d4a72e7e Mon Sep 17 00:00:00 2001 From: Sam Huynh Date: Tue, 19 Mar 2024 15:02:45 +1100 Subject: [PATCH 1/2] feat: add woolworth service for referral --- src/commands/referral/services.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/commands/referral/services.ts b/src/commands/referral/services.ts index 4746e4ed..aef76d9f 100644 --- a/src/commands/referral/services.ts +++ b/src/commands/referral/services.ts @@ -1,6 +1,5 @@ -// serivce data is scraped from -// https://www.ozbargain.com.au/user/83105/edit/referrals -export const services = [ +// serivce data is scraped from https://www.ozbargain.com.au/user/83105/edit/referrals +const OZBARGAIN_SERVICES: string[] = [ '1st energy', '3commas', 'abra', @@ -729,12 +728,16 @@ export const services = [ 'zwift', ]; +const CUSTOM_SERVICES: string[] = ['everyday rewards (woolworth & big W)']; + +export const services: string[] = [...new Set([...OZBARGAIN_SERVICES, ...CUSTOM_SERVICES])]; + const options = services.map((service) => ({ name: service, value: service, })); -export const searchServices = (term?: string) => { +export const searchServices = (term: string) => { const cleanedTerm = term?.trim().toLowerCase(); return options.filter((service) => (cleanedTerm ? service.name.includes(cleanedTerm) : true)).slice(0, 25); From c1c2569a771f3b2fe6c9a7e84b2373944197602e Mon Sep 17 00:00:00 2001 From: Sam Huynh Date: Tue, 19 Mar 2024 16:03:41 +1100 Subject: [PATCH 2/2] chore: fix typo in comments Co-authored-by: Luan Nguyen --- src/commands/referral/services.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/referral/services.ts b/src/commands/referral/services.ts index aef76d9f..dd1edeeb 100644 --- a/src/commands/referral/services.ts +++ b/src/commands/referral/services.ts @@ -1,4 +1,4 @@ -// serivce data is scraped from https://www.ozbargain.com.au/user/83105/edit/referrals +// service data is scraped from https://www.ozbargain.com.au/user/83105/edit/referrals const OZBARGAIN_SERVICES: string[] = [ '1st energy', '3commas',