mirror of
https://github.com/sasjs/adapter.git
synced 2025-12-11 01:14:36 +00:00
fix(request): update typings and documentation for request method
This commit is contained in:
14
src/SASjs.ts
14
src/SASjs.ts
@@ -530,15 +530,19 @@ export default class SASjs {
|
|||||||
* @param config - provide any changes to the config here, for instance to
|
* @param config - provide any changes to the config here, for instance to
|
||||||
* enable/disable `debug`. Any change provided will override the global config,
|
* enable/disable `debug`. Any change provided will override the global config,
|
||||||
* for that particular function call.
|
* for that particular function call.
|
||||||
* @param loginRequiredCallback - provide a function here to be called if the
|
* @param loginRequiredCallback - a function that is called if the
|
||||||
* user is not logged in (eg to display a login form). The request will be
|
* user is not logged in (eg to display a login form). The request will be
|
||||||
* resubmitted after logon.
|
* resubmitted after successful login.
|
||||||
|
* When using a `loginRequiredCallback`, the call to the request will look, for example, like so:
|
||||||
|
* `await request(sasJobPath, data, config, () => setIsLoggedIn(false))`
|
||||||
|
* If you are not passing in any data and configuration, it will look like so:
|
||||||
|
* `await request(sasJobPath, {}, {}, () => setIsLoggedIn(false))`
|
||||||
*/
|
*/
|
||||||
public async request(
|
public async request(
|
||||||
sasJob: string,
|
sasJob: string,
|
||||||
data: any,
|
data: { [key: string]: any },
|
||||||
config: any = {},
|
config: { [key: string]: any } = {},
|
||||||
loginRequiredCallback?: any,
|
loginRequiredCallback?: () => any,
|
||||||
accessToken?: string
|
accessToken?: string
|
||||||
) {
|
) {
|
||||||
config = {
|
config = {
|
||||||
|
|||||||
Reference in New Issue
Block a user