From bbe736e2975e6cb1b96ca40df305c5f491ebc1db Mon Sep 17 00:00:00 2001 From: Admin Date: Fri, 24 Apr 2020 21:58:30 +0300 Subject: [PATCH] Added restrict_value Fix service request payload --- .angulardoc.json | 4 ++++ projects/ngx-dadata/src/lib/dadata-config.ts | 1 + projects/ngx-dadata/src/lib/ngx-dadata.service.ts | 7 ++++--- 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 .angulardoc.json diff --git a/.angulardoc.json b/.angulardoc.json new file mode 100644 index 0000000..7ebcdab --- /dev/null +++ b/.angulardoc.json @@ -0,0 +1,4 @@ +{ + "repoId": "b857b096-773a-4ba6-93aa-23a1376c6a93", + "lastSync": 0 +} \ No newline at end of file diff --git a/projects/ngx-dadata/src/lib/dadata-config.ts b/projects/ngx-dadata/src/lib/dadata-config.ts index 0d81f1a..a127db2 100644 --- a/projects/ngx-dadata/src/lib/dadata-config.ts +++ b/projects/ngx-dadata/src/lib/dadata-config.ts @@ -41,6 +41,7 @@ export interface DadataConfig { locations?: Location[]; locationsBoost?: Location[]; bounds?: Bounds; + restrict_value?: boolean; } export const DadataConfigDefault: DadataConfig = { diff --git a/projects/ngx-dadata/src/lib/ngx-dadata.service.ts b/projects/ngx-dadata/src/lib/ngx-dadata.service.ts index ed4760c..8996a8f 100644 --- a/projects/ngx-dadata/src/lib/ngx-dadata.service.ts +++ b/projects/ngx-dadata/src/lib/ngx-dadata.service.ts @@ -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('https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest/' + type, body, httpOptions); }