Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add woolworth service for referral #212

Merged
merged 2 commits into from
Mar 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/commands/referral/services.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// serivce data is scraped from
// https://www.ozbargain.com.au/user/83105/edit/referrals
export const services = [
// service data is scraped from https://www.ozbargain.com.au/user/83105/edit/referrals
const OZBARGAIN_SERVICES: string[] = [
'1st energy',
'3commas',
'abra',
Expand Down Expand Up @@ -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])];

jkiller295 marked this conversation as resolved.
Show resolved Hide resolved
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);
Expand Down
Loading