From 07383b206437b58860f26313be20895c73b9c7cf Mon Sep 17 00:00:00 2001 From: Maurits Lourens Date: Mon, 30 Aug 2021 22:55:12 +0200 Subject: [PATCH 1/2] add patch method to the rest api interface --- packages/server/src/integrations/rest.ts | 35 ++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/packages/server/src/integrations/rest.ts b/packages/server/src/integrations/rest.ts index c55e991980..d6cf71e324 100644 --- a/packages/server/src/integrations/rest.ts +++ b/packages/server/src/integrations/rest.ts @@ -89,6 +89,26 @@ module RestModule { }, }, }, + patch: { + displayName: "PATCH", + readable: true, + type: QueryTypes.FIELDS, + urlDisplay: true, + fields: { + path: { + type: DatasourceFieldTypes.STRING, + }, + queryString: { + type: DatasourceFieldTypes.STRING, + }, + headers: { + type: DatasourceFieldTypes.OBJECT, + }, + requestBody: { + type: DatasourceFieldTypes.JSON, + }, + }, + }, delete: { displayName: "DELETE", type: QueryTypes.FIELDS, @@ -175,6 +195,21 @@ module RestModule { return await this.parseResponse(response) } + async patch({ path = "", queryString = "", headers = {}, json = {} }) { + this.headers = { + ...this.config.defaultHeaders, + ...headers, + } + + const response = await fetch(this.config.url + path + queryString, { + method: "PATCH", + headers: this.headers, + body: JSON.stringify(json), + }) + + return await this.parseResponse(response) + } + async delete({ path = "", queryString = "", headers = {} }) { this.headers = { ...this.config.defaultHeaders, From 08d0f4101c5595719d1f1b493da6dc9296d72143 Mon Sep 17 00:00:00 2001 From: Maurits Lourens Date: Mon, 30 Aug 2021 23:12:19 +0200 Subject: [PATCH 2/2] fixes uploading organisation logo --- .../src/pages/builder/portal/settings/organisation.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/src/pages/builder/portal/settings/organisation.svelte b/packages/builder/src/pages/builder/portal/settings/organisation.svelte index b036585e22..1bd3dc9677 100644 --- a/packages/builder/src/pages/builder/portal/settings/organisation.svelte +++ b/packages/builder/src/pages/builder/portal/settings/organisation.svelte @@ -38,7 +38,7 @@ let data = new FormData() data.append("file", file) const res = await post( - "/api/admin/configs/upload/settings/logoUrl", + "/api/global/configs/upload/settings/logoUrl", data, {} )