update
This commit is contained in:
14
pkg/cart/mutation_set_user_id.go
Normal file
14
pkg/cart/mutation_set_user_id.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package cart
|
||||
|
||||
import (
|
||||
"errors"
|
||||
messages "git.tornberg.me/go-cart-actor/pkg/messages"
|
||||
)
|
||||
|
||||
func SetUserId(grain *CartGrain, req *messages.SetUserId) error {
|
||||
if req.UserId == "" {
|
||||
return errors.New("user ID cannot be empty")
|
||||
}
|
||||
grain.userId = req.UserId
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user