fix(gdpr): radera user_terms_consents vid kontoradering + klassa i residual-testet
CI / Typecheck, test & build (push) Successful in 11m6s
CI / Typecheck, test & build (push) Successful in 11m6s
This commit is contained in:
@@ -390,6 +390,7 @@ describe("DELETE /v1/me — GDPR residual completeness", () => {
|
|||||||
password_reset_tokens: ["user_id"],
|
password_reset_tokens: ["user_id"],
|
||||||
refresh_tokens: ["user_id"],
|
refresh_tokens: ["user_id"],
|
||||||
user_consents: ["user_id"],
|
user_consents: ["user_id"],
|
||||||
|
user_terms_consents: ["user_id"],
|
||||||
user_preferences: ["user_id"],
|
user_preferences: ["user_id"],
|
||||||
user_health_profiles: ["user_id"],
|
user_health_profiles: ["user_id"],
|
||||||
user_locale_preferences: ["user_id"],
|
user_locale_preferences: ["user_id"],
|
||||||
@@ -446,6 +447,7 @@ describe("DELETE /v1/me — GDPR residual completeness", () => {
|
|||||||
["password_reset_tokens", "user_id"],
|
["password_reset_tokens", "user_id"],
|
||||||
["refresh_tokens", "user_id"],
|
["refresh_tokens", "user_id"],
|
||||||
["user_consents", "user_id"],
|
["user_consents", "user_id"],
|
||||||
|
["user_terms_consents", "user_id"],
|
||||||
["user_preferences", "user_id"],
|
["user_preferences", "user_id"],
|
||||||
["user_health_profiles", "user_id"],
|
["user_health_profiles", "user_id"],
|
||||||
["user_locale_preferences", "user_id"],
|
["user_locale_preferences", "user_id"],
|
||||||
|
|||||||
@@ -188,6 +188,17 @@ export async function eraseUser(db: Database, userId: string): Promise<ErasureLo
|
|||||||
count: consentsDel.length,
|
count: consentsDel.length,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const termsConsentsDel = await db
|
||||||
|
.delete(schema.userTermsConsents)
|
||||||
|
.where(eq(schema.userTermsConsents.userId, userId))
|
||||||
|
.returning({ userId: schema.userTermsConsents.userId });
|
||||||
|
if (termsConsentsDel.length)
|
||||||
|
log.push({
|
||||||
|
table: getTableName(schema.userTermsConsents),
|
||||||
|
action: "delete",
|
||||||
|
count: termsConsentsDel.length,
|
||||||
|
});
|
||||||
|
|
||||||
const idemDel = await db
|
const idemDel = await db
|
||||||
.delete(schema.idempotencyKeys)
|
.delete(schema.idempotencyKeys)
|
||||||
.where(eq(schema.idempotencyKeys.userId, userId))
|
.where(eq(schema.idempotencyKeys.userId, userId))
|
||||||
|
|||||||
Reference in New Issue
Block a user