diff --git a/packages/nc-gui/components/project/spreadsheet/components/moreActions.vue b/packages/nc-gui/components/project/spreadsheet/components/moreActions.vue index 898824d813..fe5ad1faff 100644 --- a/packages/nc-gui/components/project/spreadsheet/components/moreActions.vue +++ b/packages/nc-gui/components/project/spreadsheet/components/moreActions.vue @@ -237,10 +237,13 @@ export default { while (!isNaN(offset) && offset > -1) { let res if (this.publicViewId) { - res = await this.$api.public.csvExport(this.publicViewId, ExportTypes.CSV, this.reqPayload, { + res = await this.$api.public.csvExport(this.publicViewId, ExportTypes.CSV, { responseType: 'blob', query: { offset + }, + headers: { + 'xc-password': this.reqPayload && this.reqPayload.password } }) } else { diff --git a/packages/nocodb-sdk/src/lib/Api.ts b/packages/nocodb-sdk/src/lib/Api.ts index 00c92097e7..f9f805339d 100644 --- a/packages/nocodb-sdk/src/lib/Api.ts +++ b/packages/nocodb-sdk/src/lib/Api.ts @@ -2948,20 +2948,17 @@ export class Api< * * @tags Public * @name CsvExport - * @request POST:/api/v1/db/public/shared-view/{sharedViewUuid}/rows/export/{type} + * @request GET:/api/v1/db/public/shared-view/{sharedViewUuid}/rows/export/{type} * @response `200` `any` OK */ csvExport: ( sharedViewUuid: string, type: 'csv' | 'excel', - data: { password?: string; filters?: FilterType[]; sorts?: SortType[] }, params: RequestParams = {} ) => this.request({ path: `/api/v1/db/public/shared-view/${sharedViewUuid}/rows/export/${type}`, - method: 'POST', - body: data, - type: ContentType.Json, + method: 'GET', wrapped: true, ...params, }), diff --git a/packages/nocodb/src/lib/noco/meta/api/publicApis/publicDataExportApis.ts b/packages/nocodb/src/lib/noco/meta/api/publicApis/publicDataExportApis.ts index 9a0434ec8e..4ffce25ba8 100644 --- a/packages/nocodb/src/lib/noco/meta/api/publicApis/publicDataExportApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/publicApis/publicDataExportApis.ts @@ -188,5 +188,8 @@ async function serializeCellValue({ } const router = Router({ mergeParams: true }); -router.post('/public/data/:publicDataUuid/export/csv', catchError(exportCsv)); +router.get( + '/api/v1/db/public/shared-view/:publicDataUuid/rows/export/csv', + catchError(exportCsv) +); export default router; diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index 8b35affff3..a7d75bf5d0 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -3642,7 +3642,7 @@ "required": true } ], - "post": { + "get": { "summary": "", "operationId": "public-csv-export", "description": "", @@ -3666,33 +3666,7 @@ }, "tags": [ "Public" - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "password": { - "type": "string" - }, - "filters": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Filter" - } - }, - "sorts": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Sort" - } - } - } - } - } - } - } + ] } }, "/api/v1/db/public/shared-view/{sharedViewUuid}/nested/{columnName}": {