File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -21,15 +21,9 @@ export function getLogsLink({dbName, logging}: GetLogsLinkProps): string {
2121 if ( queryParam ) {
2222 const decodedQuery = decodeURIComponent ( queryParam ) ;
2323
24- // Gets content between curly braces and replaces with {content, database = "dbName"}
25- const updatedQuery = decodedQuery . replace ( / \{ ( [ ^ } ] * ) \} / , ( _match , contents ) => {
26- const trimmedContents = contents . trim ( ) ;
27- if ( trimmedContents ) {
28- return `{${ trimmedContents } , database = "${ dbName } "}` ;
29- } else {
30- return `{database = "${ dbName } "}` ;
31- }
32- } ) ;
24+ const queryBetweenBraces = decodedQuery . slice ( 1 , - 1 ) ;
25+ const witComma = queryBetweenBraces . length > 0 ;
26+ const updatedQuery = `{${ queryBetweenBraces } ${ witComma ? ', ' : '' } database = "${ dbName } "}` ;
3327
3428 url . searchParams . set ( 'query' , updatedQuery ) ;
3529 }
You can’t perform that action at this time.
0 commit comments