Skip to content

Commit 4ae5be3

Browse files
Fix location picker suggestions API requests
1 parent 1b7052c commit 4ae5be3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/controls/locationPicker/LocationPicker.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22
import { ILocationPickerProps, ILocationPickerState, Mode, ILocationBoxOption, ILocationPickerItem } from './ILocationPicker';
33
import styles from './LocationPicker.module.scss';
4-
import { SPHttpClient, ISPHttpClientOptions, SPHttpClientResponse, AadHttpClient } from '@microsoft/sp-http';
4+
import { SPHttpClient, ISPHttpClientOptions, SPHttpClientResponse, HttpClient, HttpClientResponse } from '@microsoft/sp-http';
55
import { Text } from 'office-ui-fabric-react/lib/Text';
66
import { Persona, PersonaSize } from 'office-ui-fabric-react/lib/Persona';
77
import { ComboBox } from 'office-ui-fabric-react/lib/ComboBox';
@@ -276,8 +276,7 @@ export class LocationPicker extends React.Component<ILocationPickerProps, ILocat
276276
body: `{"QueryConstraint":{"Query":"${searchText}"},"LocationProvider":32,"BingMarket":"en-IN"}`,
277277
headers: requestHeaders
278278
};
279-
let client1: AadHttpClient = await this.props.context.aadHttpClientFactory.getClient("https://outlook.office365.com");
280-
let response1 = await client1.post("https://outlook.office365.com/SchedulingB2/api/v1.0/me/findmeetinglocations", AadHttpClient.configurations.v1, spOpts);
279+
let response1: HttpClientResponse = await this.props.context.httpClient.post("https://outlook.office365.com/SchedulingB2/api/v1.0/me/findmeetinglocations", HttpClient.configurations.v1, spOpts);
281280
let json = await response1.json();
282281

283282

0 commit comments

Comments
 (0)