From ca20208041055f518bc5f3c4a2a09df211ea233e Mon Sep 17 00:00:00 2001 From: Jonathan Barrow Date: Wed, 14 Jun 2023 13:02:42 -0400 Subject: [PATCH] Fixed PNID scrubbing not saving default Mii data --- src/models/pnid.ts | 62 ++++++++++++++++++---------------------------- 1 file changed, 24 insertions(+), 38 deletions(-) diff --git a/src/models/pnid.ts b/src/models/pnid.ts index 758fb5f..36b1830 100644 --- a/src/models/pnid.ts +++ b/src/models/pnid.ts @@ -241,7 +241,7 @@ PNIDSchema.method('scrub', async function scrub() { await this.updateMii({ name: 'Default', - primary: 'N', + primary: 'Y', data: 'AwAAQOlVognnx0GC2/uogAOzuI0n2QAAAEBEAGUAZgBhAHUAbAB0AAAAAAAAAEBAAAAhAQJoRBgmNEYUgRIXaA0AACkAUkhQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGm9' }); @@ -251,44 +251,30 @@ PNIDSchema.method('scrub', async function scrub() { this.gender = ''; this.country = ''; this.language = ''; - this.email = { - address: '', - primary: false, - parent: false, - reachable: false, - validated: false, - validated_date: '', - id: 0 - }; + this.email.address = ''; + this.email.primary = false; + this.email.parent = false; + this.email.reachable = false; + this.email.validated = false; + this.email.validated_date = ''; + this.email.id = 0; this.region = 0; - this.timezone = { - name: '', - offset: 0 - }; - this.mii = { - id: 0, - hash: '', - image_url: '', - image_id: 0 - }; - this.flags = { - active: false, - marketing: false, - off_device: false - }; - this.connections = { - discord: { - id: '' - }, - stripe: { - customer_id: '', - subscription_id: '', - price_id: '', - tier_level: 0, - tier_name: '', - latest_webhook_timestamp: 0 - } - }; + this.timezone.name = ''; + this.timezone.offset = 0; + this.mii.id = 0; + this.mii.hash = ''; + this.mii.image_url = ''; + this.mii.image_id = 0; + this.flags.active = false; + this.flags.marketing = false; + this.flags.off_device = false; + this.connections.discord.id = ''; + this.connections.stripe.customer_id = ''; + this.connections.stripe.subscription_id = ''; + this.connections.stripe.price_id = ''; + this.connections.stripe.tier_level = ''; + this.connections.stripe.tier_name = ''; + this.connections.stripe.latest_webhook_timestamp = ''; }); export const PNID: PNIDModel = model('PNID', PNIDSchema); \ No newline at end of file