diff --git a/app/client/ui/FormAPI.ts b/app/client/ui/FormAPI.ts index 1e2d65ae..415d3fc0 100644 --- a/app/client/ui/FormAPI.ts +++ b/app/client/ui/FormAPI.ts @@ -1,5 +1,6 @@ import {BaseAPI, IOptions} from 'app/common/BaseAPI'; import {CellValue, ColValues} from 'app/common/DocActions'; +import {addCurrentOrgToPath} from 'app/common/urlUtils'; /** * Form and associated field metadata from a Grist view section. @@ -82,11 +83,8 @@ interface CreateRecordWithShareKeyOptions extends CreateRecordCommonOptions { type CreateRecordOptions = CreateRecordWithDocIdOptions | CreateRecordWithShareKeyOptions; export class FormAPIImpl extends BaseAPI implements FormAPI { - private _url: string; - - constructor(url: string, options: IOptions = {}) { + constructor(private _homeUrl: string, options: IOptions = {}) { super(options); - this._url = url.replace(/\/$/, ''); } public async getForm(options: GetFormOptions): Promise
{ @@ -114,4 +112,8 @@ export class FormAPIImpl extends BaseAPI implements FormAPI { }); } } + + private get _url(): string { + return addCurrentOrgToPath(this._homeUrl); + } }