Skip to content

Commit

Permalink
Fix: snippets generation for queries with search parameters (#549)
Browse files Browse the repository at this point in the history
  • Loading branch information
thewahome committed May 28, 2020
1 parent c81ea73 commit 929f9fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/services/actions/snippet-action-creator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function getSnippet(language: string): Function {
const { devxApi, sampleQuery } = getState();
let snippetsUrl = `${devxApi}/api/graphexplorersnippets`;

const { requestUrl, sampleUrl, queryVersion } = parseSampleUrl(sampleQuery.sampleUrl);
const { requestUrl, sampleUrl, queryVersion, search } = parseSampleUrl(sampleQuery.sampleUrl);
if (!sampleUrl) {
throw new Error('url is invalid');
}
Expand All @@ -39,7 +39,7 @@ export function getSnippet(language: string): Function {
dispatch(getSnippetPending());

// tslint:disable-next-line: max-line-length
const body = `${sampleQuery.selectedVerb} /${queryVersion}/${requestUrl} HTTP/1.1\r\nHost: graph.microsoft.com\r\nContent-Type: application/json\r\n\r\n${JSON.stringify(sampleQuery.sampleBody)}`;
const body = `${sampleQuery.selectedVerb} /${queryVersion}/${requestUrl + search} HTTP/1.1\r\nHost: graph.microsoft.com\r\nContent-Type: application/json\r\n\r\n${JSON.stringify(sampleQuery.sampleBody)}`;
const obj: any = {};
const response = await fetch(snippetsUrl, {
method: 'POST',
Expand Down

0 comments on commit 929f9fb

Please sign in to comment.