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

Fix responses body #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix response body
Kosmostars7403 committed Aug 31, 2020
commit d99bfc9d3dc91ce3318d6c07d7b5d7fc6e041e2d
1 change: 1 addition & 0 deletions projects/ngx-dadata/src/lib/dadata-config.ts
Original file line number Diff line number Diff line change
@@ -41,6 +41,7 @@ export interface DadataConfig {
locations?: Location[];
locationsBoost?: Location[];
bounds?: Bounds;
restrict_value?: boolean
}

export const DadataConfigDefault: DadataConfig = {
7 changes: 4 additions & 3 deletions projects/ngx-dadata/src/lib/ngx-dadata.service.ts
Original file line number Diff line number Diff line change
@@ -38,10 +38,11 @@ export class NgxDadataService {
{},
{query: value},
{count: config?.limit},
{location: config?.locations},
{location_bust: config?.locationsBoost},
{locations: config?.locations},
{location_boost: config?.locationsBoost},
{from_bound: config?.bounds?.fromBound},
{to_bound: config?.bounds?.toBound}
{to_bound: config?.bounds?.toBound},
{restrict_value: config?.restrict_value?}
);
return this.http.post<DadataResponse>('https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest/' + type, body, httpOptions);
}