Skip to content

Feature/working branch#2

Draft
rochellechann wants to merge 3 commits intomainfrom
feature/working-branch
Draft

Feature/working branch#2
rochellechann wants to merge 3 commits intomainfrom
feature/working-branch

Conversation

@rochellechann
Copy link
Copy Markdown
Collaborator

Summary:
This is a working branch that adds a new cart reducer to retrieve product information from the cart. I also removed some files that we do not use at the moment so make it more simplified.

@rochellechann rochellechann requested a review from MFennig July 8, 2021 17:58
cartResponse: [],
};

public [CartAction.REQUEST_PRODUCT](state: ICartState, action: IAction<CartResponseModel>): any {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Need to update the type as CartResponseModel instead of any.

};
}

public [CartAction.REQUEST_PRODUCT_FINISHED](state: ICartState, action: IAction<CartResponseModel>): any {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Need to update the type as CartResponseModel instead of any.

}

return !Array.isArray(response.data) ? new Model(response.data) : (response.data.map((json) => new Model(json)) as any);
return !Array.isArray(response.data) ? new Model(response.data.data) : (response.data.map((json) => new Model(json)) as any);
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We can just this on the api side so its not too nested with the response that comes back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants