Skip to content

Commit

Permalink
remove duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
Shakeel committed Jan 2, 2025
1 parent b235bd7 commit 0145732
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions includes/admin/page-optimizer/src/services/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,22 +102,29 @@ class ApiService {
}
}

this.setSearchParams({
action: 'fetch_page_speed',
url,
strategy: activeReport,
new: reload as unknown as string,
is_dev: isDev as unknown as string
});
// this.setSearchParams({
// action: 'fetch_page_speed',
// url,
// strategy: activeReport,
// new: reload as unknown as string,
// is_dev: isDev as unknown as string
// });

//console.log("this.baseURL: ", this.baseURL)
// const query = new URLSearchParams();
const query = new URLSearchParams();

// this.baseURL.searchParams.append('action', 'fetch_page_speed')
// this.baseURL.searchParams.append('url', url)
// this.baseURL.searchParams.append('strategy', activeReport)
// this.baseURL.searchParams.append('new', reload as unknown as string)
// this.baseURL.searchParams.append('is_dev', isDev as unknown as string)
// Clear existing search params before adding new ones
this.baseURL.searchParams.delete('action');
this.baseURL.searchParams.delete('url');
this.baseURL.searchParams.delete('strategy');
this.baseURL.searchParams.delete('new');
this.baseURL.searchParams.delete('is_dev');

this.baseURL.searchParams.append('action', 'fetch_page_speed')
this.baseURL.searchParams.append('url', url)
this.baseURL.searchParams.append('strategy', activeReport)
this.baseURL.searchParams.append('new', reload as unknown as string)
this.baseURL.searchParams.append('is_dev', isDev as unknown as string)
// this.baseURL.searchParams.append('settingsMode', settingsMode || '')

const response = await fetch(this.baseURL, {
Expand Down

0 comments on commit 0145732

Please sign in to comment.