Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Merge anonymous carts upon login #58

Merged
merged 1 commit into from
Jun 6, 2017
Merged

Merge anonymous carts upon login #58

merged 1 commit into from
Jun 6, 2017

Conversation

mjrousos
Copy link
Collaborator

@mjrousos mjrousos commented Jun 6, 2017

Add a 'merge cart' function and update ApiGateway to use it to merge guest carts into auth'd carts when users login.

Fixes #54

exports.mergeCartsAsync = (destUserId, userIds) => {
return new Promise((resolve, reject) => {
var args = [cartKey(destUserId)].concat(userIds.map(userId => cartKey(userId)));
redisClient.sunionstore( args, (error, result) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bonus space before args

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Fixed.

@chlowell
Copy link
Collaborator

chlowell commented Jun 6, 2017

Looks good to me.

guest carts into auth'd carts when users login.

Fixes #54
@mjrousos mjrousos merged commit 05ccd70 into Glimpse:master Jun 6, 2017
@mjrousos mjrousos deleted the Issue54-PreserveCart branch June 6, 2017 17:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants