17 lines
350 B
Go
17 lines
350 B
Go
package cart
|
|
|
|
import (
|
|
"fmt"
|
|
messages "git.tornberg.me/go-cart-actor/pkg/messages"
|
|
)
|
|
|
|
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)
|
|
}
|