Surface regulation and user agent across consent record API layers
Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -103,8 +103,8 @@ type (
|
||||
ConsentData json.RawMessage
|
||||
Action coredata.CookieConsentAction
|
||||
SdkVersion string
|
||||
Regulation Regulation
|
||||
CountryCode coredata.CountryCode
|
||||
Regulation *Regulation
|
||||
CountryCode *coredata.CountryCode
|
||||
}
|
||||
|
||||
DetectedCookie struct {
|
||||
@@ -1847,6 +1847,10 @@ func (s *Service) RecordConsent(
|
||||
CreatedAt: time.Now(),
|
||||
}
|
||||
|
||||
if record.Regulation != nil && *record.Regulation == coredata.RegulationNone {
|
||||
record.Regulation = nil
|
||||
}
|
||||
|
||||
if err := record.Insert(ctx, tx, scope); err != nil {
|
||||
return fmt.Errorf("cannot insert consent record: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user