From 0882a50cfdf67934e1c5c5d038e2abd2b2175812 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Fri, 2 Sep 2022 10:45:20 +0200 Subject: [PATCH] fix: Requests using GET that should be POST, related #4042 --- app/models/Collection.ts | 2 +- app/stores/DocumentsStore.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/Collection.ts b/app/models/Collection.ts index 623e78837..1ef41886b 100644 --- a/app/models/Collection.ts +++ b/app/models/Collection.ts @@ -216,7 +216,7 @@ export default class Collection extends ParanoidModel { }; export = () => { - return client.get("/collections.export", { + return client.post("/collections.export", { id: this.id, }); }; diff --git a/app/stores/DocumentsStore.ts b/app/stores/DocumentsStore.ts index 333d617b0..a8191ed4f 100644 --- a/app/stores/DocumentsStore.ts +++ b/app/stores/DocumentsStore.ts @@ -381,7 +381,7 @@ export default class DocumentsStore extends BaseStore { @action searchTitles = async (query: string) => { - const res = await client.get("/documents.search_titles", { + const res = await client.post("/documents.search_titles", { query, }); invariant(res?.data, "Search response should be available"); @@ -397,7 +397,7 @@ export default class DocumentsStore extends BaseStore { options: SearchParams ): Promise => { const compactedOptions = omitBy(options, (o) => !o); - const res = await client.get("/documents.search", { + const res = await client.post("/documents.search", { ...compactedOptions, query, });