Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service is broken #8

Open
SamarinDV opened this issue Apr 24, 2020 · 1 comment
Open

Service is broken #8

SamarinDV opened this issue Apr 24, 2020 · 1 comment

Comments

@SamarinDV
Copy link

Found some errors in code:

getData(value: string, type: DadataType = DadataType.address, config: DadataConfig): Observable {
const httpOptions = {
headers: new HttpHeaders({
Accept: 'application/json',
'Content-Type': 'application/json',
Authorization: 'Token ' + this.apiKey,
})
};
const body = Object.assign(
{},
{query: value},
{count: config?.limit},
{location: config?.locations},
{location_bust: config?.locationsBoost},
{from_bound: config?.bounds?.fromBound},
{to_bound: config?.bounds?.toBound}
);
return this.http.post('https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest/' + type, body, httpOptions);
}

should be:

getData(value: string, type: DadataType = DadataType.address, config: DadataConfig): Observable {
const httpOptions = {
headers: new HttpHeaders({
Accept: 'application/json',
'Content-Type': 'application/json',
Authorization: 'Token ' + this.apiKey,
})
};
const body = Object.assign(
{},
{query: value},
{count: config?.limit},
{locations: config?.locations},
{location_boost: config?.locationsBoost},
{from_bound: config?.bounds?.fromBound},
{to_bound: config?.bounds?.toBound}
);
return this.http.post('https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest/' + type, body, httpOptions);
}

@kolkov
Copy link
Owner

kolkov commented Apr 24, 2020

Hi! Thanks! Can you make a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants