react-native-gigya-sdk
Version:
SAP CDC/Gigya SDK for your React Native applications
29 lines (28 loc) • 1.17 kB
JavaScript
import getState from './getState';
import sendApiCall from './sendApiCall';
export default function (loginID, password, options) {
return new Promise(async (resolve, reject) => {
try {
var _state$regToken;
const state = await getState();
const response = await sendApiCall('accounts.linkAccounts', {
loginID,
password,
targetEnv: 'mobile',
...((options === null || options === void 0 ? void 0 : options.noUID) && {
regToken: (options === null || options === void 0 ? void 0 : options.regToken) || ((_state$regToken = state.regToken) === null || _state$regToken === void 0 ? void 0 : _state$regToken.value)
}),
...(!(options !== null && options !== void 0 && options.noUID) && {
UID: (options === null || options === void 0 ? void 0 : options.UID) || state.UID
}),
...((options === null || options === void 0 ? void 0 : options.include) && {
include: options === null || options === void 0 ? void 0 : options.include
})
});
resolve(response);
} catch (e) {
reject(e);
}
});
}
//# sourceMappingURL=linkToSite.js.map