Skip to content

Commit

Permalink
Change http methods on route settings route
Browse files Browse the repository at this point in the history
  • Loading branch information
bidoubiwa committed Jun 15, 2022
1 parent cdbcda4 commit 14318bb
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/indexes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ class Index<T = Record<string, any>> {
options?: AddDocumentParams
): Promise<EnqueuedTask> {
const url = `indexes/${this.uid}/documents`
return await this.httpRequest.post(url, documents, options)
return await this.httpRequest.put(url, documents, options)
}

/**
Expand Down Expand Up @@ -446,7 +446,7 @@ class Index<T = Record<string, any>> {
): Promise<EnqueuedTask> {
const url = `indexes/${this.uid}/documents/delete-batch`

return await this.httpRequest.post(url, documentsIds)
return await this.httpRequest.put(url, documentsIds)
}

/**
Expand Down Expand Up @@ -485,7 +485,7 @@ class Index<T = Record<string, any>> {
*/
async updateSettings(settings: Settings): Promise<EnqueuedTask> {
const url = `indexes/${this.uid}/settings`
return await this.httpRequest.post(url, settings)
return await this.httpRequest.patch(url, settings)
}

/**
Expand Down Expand Up @@ -523,7 +523,7 @@ class Index<T = Record<string, any>> {
*/
async updateSynonyms(synonyms: Synonyms): Promise<EnqueuedTask> {
const url = `indexes/${this.uid}/settings/synonyms`
return await this.httpRequest.post(url, synonyms)
return await this.httpRequest.put(url, synonyms)
}

/**
Expand Down Expand Up @@ -561,7 +561,7 @@ class Index<T = Record<string, any>> {
*/
async updateStopWords(stopWords: StopWords): Promise<EnqueuedTask> {
const url = `indexes/${this.uid}/settings/stop-words`
return await this.httpRequest.post(url, stopWords)
return await this.httpRequest.put(url, stopWords)
}

/**
Expand Down Expand Up @@ -599,7 +599,7 @@ class Index<T = Record<string, any>> {
*/
async updateRankingRules(rankingRules: RankingRules): Promise<EnqueuedTask> {
const url = `indexes/${this.uid}/settings/ranking-rules`
return await this.httpRequest.post(url, rankingRules)
return await this.httpRequest.put(url, rankingRules)
}

/**
Expand Down Expand Up @@ -639,7 +639,7 @@ class Index<T = Record<string, any>> {
distinctAttribute: DistinctAttribute
): Promise<EnqueuedTask> {
const url = `indexes/${this.uid}/settings/distinct-attribute`
return await this.httpRequest.post(url, distinctAttribute)
return await this.httpRequest.put(url, distinctAttribute)
}

/**
Expand Down Expand Up @@ -679,7 +679,7 @@ class Index<T = Record<string, any>> {
filterableAttributes: FilterableAttributes
): Promise<EnqueuedTask> {
const url = `indexes/${this.uid}/settings/filterable-attributes`
return await this.httpRequest.post(url, filterableAttributes)
return await this.httpRequest.put(url, filterableAttributes)
}

/**
Expand Down Expand Up @@ -719,7 +719,7 @@ class Index<T = Record<string, any>> {
sortableAttributes: SortableAttributes
): Promise<EnqueuedTask> {
const url = `indexes/${this.uid}/settings/sortable-attributes`
return await this.httpRequest.post(url, sortableAttributes)
return await this.httpRequest.put(url, sortableAttributes)
}

/**
Expand Down Expand Up @@ -759,7 +759,7 @@ class Index<T = Record<string, any>> {
searchableAttributes: SearchableAttributes
): Promise<EnqueuedTask> {
const url = `indexes/${this.uid}/settings/searchable-attributes`
return await this.httpRequest.post(url, searchableAttributes)
return await this.httpRequest.put(url, searchableAttributes)
}

/**
Expand Down Expand Up @@ -799,7 +799,7 @@ class Index<T = Record<string, any>> {
displayedAttributes: DisplayedAttributes
): Promise<EnqueuedTask> {
const url = `indexes/${this.uid}/settings/displayed-attributes`
return await this.httpRequest.post(url, displayedAttributes)
return await this.httpRequest.put(url, displayedAttributes)
}

/**
Expand Down Expand Up @@ -839,7 +839,7 @@ class Index<T = Record<string, any>> {
typoTolerance: TypoTolerance
): Promise<EnqueuedTask> {
const url = `indexes/${this.uid}/settings/typo-tolerance`
return await this.httpRequest.post(url, typoTolerance)
return await this.httpRequest.patch(url, typoTolerance)
}

/**
Expand Down

0 comments on commit 14318bb

Please sign in to comment.