Link detected cookies to existing patterns on conflict
When a cookie pattern already exists for a banner, the insert conflict caused a continue that silently dropped the detected cookie instead of linking it to the existing pattern. Load the existing pattern to obtain its ID and proceed with cookie insertion. Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -29,9 +29,9 @@ var (
|
||||
ErrCategorySlugAlreadyExists = errors.New("a category with this slug already exists in this banner")
|
||||
ErrOriginAlreadyInUse = errors.New("origin is already used by another active cookie banner")
|
||||
ErrConsentNotFound = errors.New("consent record not found")
|
||||
ErrCookieNotFound = errors.New("cookie not found")
|
||||
ErrCategoriesBannerMismatch = errors.New("source and target categories belong to different banners")
|
||||
ErrPostHogConsentKindInvalid = errors.New("PostHog consent can only be enabled on normal categories")
|
||||
ErrCookieNotFound = errors.New("cookie not found")
|
||||
ErrCategoriesBannerMismatch = errors.New("source and target categories belong to different banners")
|
||||
ErrPostHogConsentKindInvalid = errors.New("PostHog consent can only be enabled on normal categories")
|
||||
ErrCookiePatternNotFound = errors.New("cookie pattern not found")
|
||||
ErrPatternAlreadyExists = errors.New("a pattern with this name already exists in this banner")
|
||||
ErrSamePatternCategoryMove = errors.New("source and target cookie categories must be different")
|
||||
|
||||
Reference in New Issue
Block a user