Skip to content

Commit

Permalink
Revert api file and add extra quote for regex matching
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Ho <[email protected]>
  • Loading branch information
derek-ho committed Sep 19, 2023
1 parent e6e3a5c commit b448987
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions public/components/context_menu/context_menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ const generateInContextReport = async (
reportSource = 'Saved search';
}

console.log( `${getApiPath()}/reporting/generateReport?${new URLSearchParams(
uiSettingsService.getSearchParams()
)}`)

// create query body
const contextMenuOnDemandReport = {
query_url: queryUrl,
Expand Down Expand Up @@ -91,7 +87,7 @@ const generateInContextReport = async (
};

fetch(
`../${getApiPath()}/reporting/generateReport?${new URLSearchParams(
`${getApiPath()}/reporting/generateReport?${new URLSearchParams(
uiSettingsService.getSearchParams()
)}`,
{
Expand Down
2 changes: 1 addition & 1 deletion public/components/context_menu/context_menu_helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const contextMenuViewReports = () =>
export const getTimeFieldsFromUrl = () => {
const url = unhashUrl(window.location.href);

let [, fromDateString, toDateString] = url.match(timeRangeMatcher) ?? ["now-15m", "now"];
let [, fromDateString, toDateString] = url.match(timeRangeMatcher) ?? ["", "now-15m", "now"];
fromDateString = decodeURIComponent(fromDateString.replace(/[']+/g, ''));
// convert time range to from date format in case time range is relative
const fromDateFormat = dateMath.parse(fromDateString);
Expand Down

0 comments on commit b448987

Please sign in to comment.