From e286a34d243bfd886c2fdd1f30df74f60fbe90ad Mon Sep 17 00:00:00 2001 From: Matthieu Bergel Date: Sat, 11 May 2024 14:21:56 +0000 Subject: [PATCH] refactor(gdoc): simplify subclass constructors --- db/model/Gdoc/GdocDataInsight.ts | 5 +---- db/model/Gdoc/GdocHomepage.ts | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/db/model/Gdoc/GdocDataInsight.ts b/db/model/Gdoc/GdocDataInsight.ts index cb7ffb42a33..7711031cad0 100644 --- a/db/model/Gdoc/GdocDataInsight.ts +++ b/db/model/Gdoc/GdocDataInsight.ts @@ -19,10 +19,7 @@ export class GdocDataInsight content!: OwidGdocDataInsightContent constructor(id?: string) { - super() - if (id) { - this.id = id - } + super(id) } static create(obj: OwidGdocBaseInterface): GdocDataInsight { diff --git a/db/model/Gdoc/GdocHomepage.ts b/db/model/Gdoc/GdocHomepage.ts index a0cbc6047d3..d855829af1b 100644 --- a/db/model/Gdoc/GdocHomepage.ts +++ b/db/model/Gdoc/GdocHomepage.ts @@ -20,10 +20,7 @@ export class GdocHomepage content!: OwidGdocHomepageContent constructor(id?: string) { - super() - if (id) { - this.id = id - } + super(id) } static create(obj: OwidGdocBaseInterface): GdocHomepage {