UNPKG

react-native-gigya-sdk

Version:
35 lines (29 loc) 1.28 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = _default; var _getState = _interopRequireDefault(require("./getState")); var _sendApiCall = _interopRequireDefault(require("./sendApiCall")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _default(data, options) { return new Promise(async (resolve, reject) => { try { var _state$regToken; const state = await (0, _getState.default)(); const UID = (options === null || options === void 0 ? void 0 : options.UID) || state.UID; const response = await (0, _sendApiCall.default)('accounts.setAccountInfo', { ...((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 && { UID }), ...(data !== null && data !== void 0 ? data : {}) }); resolve(response); } catch (e) { reject(e); } }); } //# sourceMappingURL=setAccountInfo.js.map