@quesmed/types-rn 2.6.85 → 2.6.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -48,6 +48,7 @@ export interface IUpdateUserSettingsVar {
|
|
|
48
48
|
input: Omit<DeepPartial<IUserSettings>, 'id' | 'userId' | 'updatedAt'>;
|
|
49
49
|
}
|
|
50
50
|
export type IUpdateUserSettingsData = RestrictedData<IUserSettings & graphqlNormalize, 'updateUserSettings'>;
|
|
51
|
+
export declare const optimisticUpdateUserSettings: (settings: Omit<IUserSettings, 'updatedAt'>) => ({ input }: IUpdateUserSettingsVar) => IUpdateUserSettingsData;
|
|
51
52
|
export declare const updateCacheOnUpdateUserSettings: (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IUpdateUserSettingsData>, options: ApolloUpdateOptions<IUpdateUserSettingsVar>) => void;
|
|
52
53
|
export declare const RENEW_TOKEN: import("@apollo/client").DocumentNode;
|
|
53
54
|
export type IRenewTokenVar = null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.optimisticVideoLearningStatus = exports.updateCacheOnVideoLearningStatusUpdate = exports.UPSERT_USER_VIDEO_STATUS = exports.optimisticStationLearningStatus = exports.updateCacheOnStationLearningStatusUpdate = exports.UPSERT_USER_STATION_STATUS = exports.optimisticConceptLearningStatus = exports.updateCacheOnConceptLearningStatusUpdate = exports.UPSERT_USER_CONCEPT_STATUS = exports.TOC_ACCEPT = exports.RENEW_TOKEN = exports.updateCacheOnUpdateUserSettings = exports.UPDATE_USER_SETTINGS = exports.UPDATE_USER = exports.DELETE_USER = exports.RESET_CATEGORY_PROGRESS = exports.RESET_PROGRESS = exports.LOGOUT_USER = void 0;
|
|
3
|
+
exports.optimisticVideoLearningStatus = exports.updateCacheOnVideoLearningStatusUpdate = exports.UPSERT_USER_VIDEO_STATUS = exports.optimisticStationLearningStatus = exports.updateCacheOnStationLearningStatusUpdate = exports.UPSERT_USER_STATION_STATUS = exports.optimisticConceptLearningStatus = exports.updateCacheOnConceptLearningStatusUpdate = exports.UPSERT_USER_CONCEPT_STATUS = exports.TOC_ACCEPT = exports.RENEW_TOKEN = exports.updateCacheOnUpdateUserSettings = exports.optimisticUpdateUserSettings = exports.UPDATE_USER_SETTINGS = exports.UPDATE_USER = exports.DELETE_USER = exports.RESET_CATEGORY_PROGRESS = exports.RESET_PROGRESS = exports.LOGOUT_USER = void 0;
|
|
4
4
|
const client_1 = require("@apollo/client");
|
|
5
5
|
const models_1 = require("../../../models");
|
|
6
6
|
const fragments_1 = require("../../fragments");
|
|
@@ -72,6 +72,24 @@ exports.UPDATE_USER_SETTINGS = (0, client_1.gql) `
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
`;
|
|
75
|
+
const optimisticUpdateUserSettings = (settings) => ({ input }) => ({
|
|
76
|
+
restricted: {
|
|
77
|
+
updateUserSettings: {
|
|
78
|
+
__typename: 'UserSettings',
|
|
79
|
+
...settings,
|
|
80
|
+
updatedAt: new Date(),
|
|
81
|
+
globalSettings: {
|
|
82
|
+
...settings.globalSettings,
|
|
83
|
+
...input.globalSettings,
|
|
84
|
+
},
|
|
85
|
+
productSettings: {
|
|
86
|
+
...settings.productSettings,
|
|
87
|
+
...input.productSettings,
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
exports.optimisticUpdateUserSettings = optimisticUpdateUserSettings;
|
|
75
93
|
const updateCacheOnUpdateUserSettings = (cache, result, options) => {
|
|
76
94
|
const { updateUserSettings } = result?.data?.restricted || {};
|
|
77
95
|
const { variables } = options || {};
|
|
@@ -87,6 +105,7 @@ const updateCacheOnUpdateUserSettings = (cache, result, options) => {
|
|
|
87
105
|
settings: updateUserSettings,
|
|
88
106
|
},
|
|
89
107
|
fragment: fragments_1.UPDATE_USER_SETTINGS_FRAGMENT,
|
|
108
|
+
fragmentName: 'UpdateUserSettingsFragment',
|
|
90
109
|
});
|
|
91
110
|
};
|
|
92
111
|
exports.updateCacheOnUpdateUserSettings = updateCacheOnUpdateUserSettings;
|