(core) remove deprecated /download endpoint in favor of newer /api/docs/NNNN/download

Summary:
This endpoint has started to fail when called between a pair
of doc workers. The simplest fix is to simply remove it, it serves no
purpose.

Test Plan: added basic deployment test

Reviewers: dsagal

Reviewed By: dsagal

Subscribers: dsagal

Differential Revision: https://phab.getgrist.com/D3636
This commit is contained in:
Paul Fitzpatrick
2022-09-20 13:27:25 -04:00
parent b2b0950c9c
commit d55b5110ac
5 changed files with 21 additions and 13 deletions

View File

@@ -755,8 +755,8 @@ export class DocWorkerAPIImpl extends BaseAPI implements DocWorkerAPI {
}
public async downloadDoc(docId: string, template: boolean = false): Promise<Response> {
const extra = template ? '&template=1' : '';
const result = await this.request(`${this.url}/download?doc=${docId}${extra}`, {
const extra = template ? '?template=1' : '';
const result = await this.request(`${this.url}/api/docs/${docId}/download${extra}`, {
method: 'GET',
});
if (!result.ok) { throw new Error(await result.text()); }