Skip to content

Commit

Permalink
construct 'URL': Invalid URL
Browse files Browse the repository at this point in the history
  • Loading branch information
amoycode committed Jul 28, 2024
1 parent 59c206d commit 790dfa3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/abc/lodop/lodop.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,15 @@ export class LodopService implements OnDestroy {
}

private requestUrl(): string {
const urlObj = new URL(this.cog.url!);
if (!this.cog.url) {
throw new Error('URL is not defined');
}
if (!this.cog.name) {
throw new Error('Name is not defined');
}
const urlObj = new URL(this.cog.url);
const params = new URLSearchParams(urlObj.search);
params.set('name', this.cog.name!);
params.set('name', this.cog.name);
urlObj.search = params.toString();
return urlObj.toString();
}
Expand Down

0 comments on commit 790dfa3

Please sign in to comment.