Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
update.extend("$auto", function(value, object) {
return object ? update(object, value) : update({}, value);
});
switch (action.type) {
CurrentUser: (prev, {mutationResult}) => {
return update(prev, {
CurrentUser: {
$set: mutationResult.data.logIn
}
})
}
}
export default function lockedAttributes(
state: LockedAttributesState = initialState,
action: AttributeAction
) {
update.extend("$auto", function(value, object) {
return object ? update(object, value) : update({}, value);
});
switch (action.type) {
case "ATTRIBUTE_LOCK":
return update(state, {
[action.chart]: { $auto: { [action.attribute]: { $set: true } } }
});
case "ATTRIBUTE_UNLOCK":
return update(state, {
[action.chart]: { $auto: { [action.attribute]: { $set: false } } }
});
case "ATTRIBUTE_REMOVE_ALL":
return initialState;
default:
return state;
}
}
UserDetails: (prev, { mutationResult }) => {
return update(prev, {
UserDetails: {
$set: mutationResult.data.selectCourse
}
})
}
}