@@ -30,4 +30,5 @@ var (
|
||||
ErrConsentNotFound = errors.New("consent record not found")
|
||||
ErrCookieNotFound = errors.New("cookie not found in source category")
|
||||
ErrCategoriesBannerMismatch = errors.New("source and target categories belong to different banners")
|
||||
ErrSameCategoryMove = errors.New("source and target cookie categories must be different")
|
||||
)
|
||||
|
||||
@@ -949,6 +949,10 @@ func (s *Service) MoveCookieToCategory(
|
||||
return fmt.Errorf("cannot load target cookie category: %w", err)
|
||||
}
|
||||
|
||||
if source.ID == target.ID {
|
||||
return ErrSameCategoryMove
|
||||
}
|
||||
|
||||
if source.CookieBannerID != target.CookieBannerID {
|
||||
return ErrCategoriesBannerMismatch
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user