From c1fefbde225efa4a866956ae0b81cbabecd9a661 Mon Sep 17 00:00:00 2001 From: lismana Date: Thu, 22 Aug 2024 14:30:29 -0400 Subject: [PATCH] more fixes for test maker --- src/shared/api/cbioportalInternalClientInstance.ts | 6 +++--- src/shared/api/testMaker.ts | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/shared/api/cbioportalInternalClientInstance.ts b/src/shared/api/cbioportalInternalClientInstance.ts index cf580fea677..282dd786846 100644 --- a/src/shared/api/cbioportalInternalClientInstance.ts +++ b/src/shared/api/cbioportalInternalClientInstance.ts @@ -1,6 +1,6 @@ import { CBioPortalAPIInternal } from 'cbioportal-ts-api-client'; import { getLoadConfig } from 'config/config'; -import { getBrowserWindow } from 'cbioportal-frontend-commons'; +import { getBrowserWindow, hashString } from 'cbioportal-frontend-commons'; import { toJS } from 'mobx'; import { reportValidationResult, validate } from 'shared/api/validation'; import _ from 'lodash'; @@ -52,8 +52,8 @@ function proxyColumnStore(client: any, endpoint: string) { setTimeout(() => { makeTest(params, url, matchedMethod[0]); }, 1000); - - validate(url, params, matchedMethod[0], 0).then( + const hash = hashString(JSON.stringify({ data: params, url })); + validate(url, params, matchedMethod[0], hash).then( (result: any) => { reportValidationResult(result); } diff --git a/src/shared/api/testMaker.ts b/src/shared/api/testMaker.ts index a8b57eb2ef2..e82150bbdf9 100644 --- a/src/shared/api/testMaker.ts +++ b/src/shared/api/testMaker.ts @@ -47,12 +47,13 @@ export async function makeTest(data: any, url: string, label: string) { url, label, studies: toJS(getBrowserWindow().studyViewPageStore.studyIds), - filterUrl: (await getBrowserWindow().studyPage.getBookmarkUrl()) - .fullUrl, + filterUrl: getBrowserWindow().studyPage.studyViewFullUrlWithFilter, }; if (getBrowserWindow().localStorage.getItem(SAVE_TEST_KEY)) saveTest(hash, entry); + + return entry; } function saveTest(hash: number, entry: any) {