19 lines
346 B
Go
19 lines
346 B
Go
package cart
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
messages "git.k6n.net/go-cart-actor/proto/cart"
|
|
)
|
|
|
|
func RemoveLineItemMarking(grain *CartGrain, req *messages.RemoveLineItemMarking) error {
|
|
|
|
for i, item := range grain.Items {
|
|
if item.Id == req.Id {
|
|
grain.Items[i].Marking = nil
|
|
return nil
|
|
}
|
|
}
|
|
return fmt.Errorf("item with ID %d not found", req.Id)
|
|
}
|