Fix destructive update behavior in n8n cookie operations
Avoid clearing existing values when optional fields are left at their defaults: only send privacyPolicyUrl/maxAgeSeconds when truthy, filter empty entries from gcmConsentTypes, and constrain consentExpiryDays to positive integers on create. Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -150,7 +150,10 @@ export async function execute(
|
||||
if (slug) input.slug = slug;
|
||||
if (categoryDescription) input.description = categoryDescription;
|
||||
if (gcmConsentTypes) {
|
||||
input.gcmConsentTypes = gcmConsentTypes.split(',').map((s) => s.trim());
|
||||
input.gcmConsentTypes = gcmConsentTypes
|
||||
.split(',')
|
||||
.map((s) => s.trim())
|
||||
.filter((s) => s.length > 0);
|
||||
}
|
||||
if (posthogConsent) input.posthogConsent = posthogConsent === 'true';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user