Skip to content

Commit 6c20792

Browse files
Merge pull request #76 from jgbernalp/fix-invalid-query-trim
OU-564: add query validation before trimming
2 parents 4e8c9ae + 9156e81 commit 6c20792

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

web/src/korrel8r-client.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ export const listDomains = () => {
1313
};
1414

1515
export const getNeighborsGraph = ({ query }: { query?: string }, depth: number) => {
16-
query = query.trim();
1716
const requestData = {
1817
method: 'POST',
1918
body: JSON.stringify({
2019
start: {
21-
queries: query ? [query] : [],
20+
queries: query ? [query.trim()] : [],
2221
},
2322
depth: depth,
2423
}),
@@ -31,12 +30,11 @@ export const getNeighborsGraph = ({ query }: { query?: string }, depth: number)
3130
};
3231

3332
export const getGoalsGraph = ({ query }: { query?: string }, goal: string) => {
34-
query = query.trim();
3533
const requestData = {
3634
method: 'POST',
3735
body: JSON.stringify({
3836
start: {
39-
queries: query ? [query] : [],
37+
queries: query ? [query.trim()] : [],
4038
},
4139
goals: [goal],
4240
}),

0 commit comments

Comments
 (0)