Skip to content

Commit 532df46

Browse files
meili-bors[bot]riccoxbidoubiwa
authored
Merge #1518
1518: Fix get typo tolerance return type r=bidoubiwa a=bidoubiwa Following #1455, this PR fixes the test of the PR. Co-authored-by: Ricco Xie <[email protected]> Co-authored-by: Charlotte Vermandel <[email protected]>
2 parents 84c5ab0 + dcb2944 commit 532df46

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/indexes.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1017,9 +1017,9 @@ class Index<T extends Record<string, any> = Record<string, any>> {
10171017
*
10181018
* @returns Promise containing the typo tolerance settings.
10191019
*/
1020-
async getTypoTolerance(): Promise<string[]> {
1020+
async getTypoTolerance(): Promise<TypoTolerance> {
10211021
const url = `indexes/${this.uid}/settings/typo-tolerance`
1022-
return await this.httpRequest.get<string[]>(url)
1022+
return await this.httpRequest.get<TypoTolerance>(url)
10231023
}
10241024

10251025
/**

tests/typo_tolerance.test.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ describe.each([{ permission: 'Master' }, { permission: 'Admin' }])(
4040

4141
test(`${permission} key: Get default typo tolerance settings`, async () => {
4242
const client = await getClient(permission)
43-
const response: string[] = await client
44-
.index(index.uid)
45-
.getTypoTolerance()
43+
const response = await client.index(index.uid).getTypoTolerance()
4644
expect(response).toEqual(defaultTypoTolerance)
4745
})
4846

0 commit comments

Comments
 (0)