Added normalize url function to check the endpoint (#2000)

This commit is contained in:
Ana 2023-11-10 13:24:47 +02:00 committed by GitHub
parent a2ce8e4ae2
commit ef5b236482
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -1,6 +1,7 @@
import { PublisherTrustedAlgorithm, Asset } from '@oceanprotocol/lib'
import { AssetSelectionAsset } from '@shared/FormInput/InputElement/AssetSelection'
import { getServiceByName } from './ddo'
import normalizeUrl from 'normalize-url'
export async function transformAssetToAssetSelection(
datasetProviderEndpoint: string,
@ -15,7 +16,8 @@ export async function transformAssetToAssetSelection(
if (
asset?.stats?.price?.value >= 0 &&
algoService?.serviceEndpoint === datasetProviderEndpoint
normalizeUrl(algoService?.serviceEndpoint) ===
normalizeUrl(datasetProviderEndpoint)
) {
let selected = false
selectedAlgorithms?.forEach((algorithm: PublisherTrustedAlgorithm) => {