Workers main URL Redirect not working, Params as well

Hi, Alief here. I’m new here and can only include 2 links.
I’m trying to use Workers to redirect a subdomain to a different domain, but it’s not working:
wa.example to

And its path, which works well:
wa.example/WantToBuy to /60123456789?text=Want%20To%20Buy

Also, I’m unable to remove params (fbclid) from the subdomain in the same script.

The route for this worker is*

How do I make it work? Thank you in advance.

Here is my full script:

addEventListener('fetch', event => {

async function fetchAndApply(request) {

let url = new URL(request.url);
let path = url.pathname;

var yourNumber = "60123456789"
const yourMessage = "'"+path+"'"

  number = yourNumber
  message = yourMessage.match(/(\d+|[a-z]+|([A-Z]([A-Z]+|[a-z]*)))/g).join('%20')

let whatsapp = '' + number + '?text=' + message

return fetch(whatsapp,request);

addEventListener('fetch', event => {
  let url = new URL(event.request.url)

  if (url.searchParams.has('fbclid'))

    fetch(url, event.request)