update stuff
Some checks failed
Build and Publish / BuildAndDeploy (push) Failing after 3m53s
Build and Publish / BuildAndDeployAmd64 (push) Failing after 42s

This commit is contained in:
matst80
2025-02-27 20:20:21 +01:00
parent d35a87e549
commit 03123bac89
5 changed files with 67 additions and 0 deletions

View File

@@ -235,6 +235,19 @@ func (c *CartGrain) HandleMessage(message *Message, isReplay bool) (*FrameWithPa
grainMutations.Inc()
var err error
switch message.Type {
case SetCartItemsType:
msg, ok := message.Content.(*messages.SetCartItems)
if !ok {
err = fmt.Errorf("expected SetCartItems")
} else {
c.mu.Lock()
c.Items = make([]*CartItem, 0, len(msg.Items))
c.mu.Unlock()
for _, item := range msg.Items {
c.AddItem(item.Sku, int(item.Quantity))
}
}
case AddRequestType:
msg, ok := message.Content.(*messages.AddRequest)
if !ok {