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