fix: Requests using GET that should be POST, related #4042

This commit is contained in:
Tom Moor
2022-09-02 10:45:20 +02:00
parent c85f3bd7b4
commit 0882a50cfd
2 changed files with 3 additions and 3 deletions

View File

@@ -216,7 +216,7 @@ export default class Collection extends ParanoidModel {
}; };
export = () => { export = () => {
return client.get("/collections.export", { return client.post("/collections.export", {
id: this.id, id: this.id,
}); });
}; };

View File

@@ -381,7 +381,7 @@ export default class DocumentsStore extends BaseStore<Document> {
@action @action
searchTitles = async (query: string) => { searchTitles = async (query: string) => {
const res = await client.get("/documents.search_titles", { const res = await client.post("/documents.search_titles", {
query, query,
}); });
invariant(res?.data, "Search response should be available"); invariant(res?.data, "Search response should be available");
@@ -397,7 +397,7 @@ export default class DocumentsStore extends BaseStore<Document> {
options: SearchParams options: SearchParams
): Promise<SearchResult[]> => { ): Promise<SearchResult[]> => {
const compactedOptions = omitBy(options, (o) => !o); const compactedOptions = omitBy(options, (o) => !o);
const res = await client.get("/documents.search", { const res = await client.post("/documents.search", {
...compactedOptions, ...compactedOptions,
query, query,
}); });