From 8b96043a70b65dea71e07e9632daa46653e38573 Mon Sep 17 00:00:00 2001 From: "mathieu J." Date: Mon, 9 Dec 2024 12:51:47 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20(AccountKit):=20Remove=20Databas?= =?UTF-8?q?eDocument=20from=20all=20Library=20Types?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Extensions/Library+Codable.swift | 9 ------- .../Extensions/RootAccount+Codable.swift | 2 +- .../Extensions/SavedActivity+Codable.swift | 8 ++---- .../Extensions/SavedCurriculum+Codable.swift | 8 ++---- .../Extensions/SavedGamepad+Codable.swift | 8 ++---- .../Extensions/SavedStory+Codable.swift | 8 ++---- .../RootAccounts/RootAccountManager.swift | 8 +++--- .../RootAccount/Library/Library+Init.swift | 25 ------------------- .../Models/RootAccount/Library/Library.swift | 25 +++++++++++-------- .../SavedActivity/SavedActivity+Init.swift | 5 +--- .../Library/SavedActivity/SavedActivity.swift | 9 ++----- .../SavedCurriculum+Init.swift | 5 +--- .../SavedCurriculum/SavedCurriculum.swift | 9 ++----- .../SavedGamepad/SavedGamepad+Init.swift | 5 +--- .../Library/SavedGamepad/SavedGamepad.swift | 9 ++----- .../Library/SavedStory/SavedStory+Init.swift | 5 +--- .../Library/SavedStory/SavedStory.swift | 9 ++----- .../Models/RootAccount/RootAccount+Init.swift | 5 ++-- 18 files changed, 42 insertions(+), 120 deletions(-) delete mode 100644 Modules/AccountKit/Sources/Models/RootAccount/Library/Library+Init.swift diff --git a/Modules/AccountKit/Sources/Extensions/Library+Codable.swift b/Modules/AccountKit/Sources/Extensions/Library+Codable.swift index 40de1b010..d7c54f7c4 100644 --- a/Modules/AccountKit/Sources/Extensions/Library+Codable.swift +++ b/Modules/AccountKit/Sources/Extensions/Library+Codable.swift @@ -2,33 +2,24 @@ // Copyright APF France handicap // SPDX-License-Identifier: Apache-2.0 -import FirebaseFirestore import SwiftUI extension Library: Codable { public init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) - self.id = try container.decodeIfPresent(String.self, forKey: .id) - self.rootOwnerUid = try container.decode(String.self, forKey: .rootOwnerUid) self.savedActivities = try container.decodeIfPresent([SavedActivity].self, forKey: .savedActivities) ?? [] self.savedCurriculums = try container.decodeIfPresent([SavedCurriculum].self, forKey: .savedCurriculums) ?? [] self.savedStories = try container.decodeIfPresent([SavedStory].self, forKey: .savedStories) ?? [] self.savedGamepads = try container.decodeIfPresent([SavedGamepad].self, forKey: .savedGamepads) ?? [] - self.createdAt = try container.decodeIfPresent(Timestamp.self, forKey: .createdAt)?.dateValue() - self.lastEditedAt = try container.decodeIfPresent(Timestamp.self, forKey: .lastEditedAt)?.dateValue() } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent(self.id, forKey: .id) - try container.encode(self.rootOwnerUid, forKey: .rootOwnerUid) try container.encode(self.savedActivities, forKey: .savedActivities) try container.encode(self.savedCurriculums, forKey: .savedCurriculums) try container.encode(self.savedStories, forKey: .savedStories) try container.encode(self.savedGamepads, forKey: .savedGamepads) - try container.encodeIfPresent(self.createdAt.map { Timestamp(date: $0) }, forKey: .createdAt) - try container.encodeIfPresent(self.lastEditedAt.map { Timestamp(date: $0) }, forKey: .lastEditedAt) } } diff --git a/Modules/AccountKit/Sources/Extensions/RootAccount+Codable.swift b/Modules/AccountKit/Sources/Extensions/RootAccount+Codable.swift index c877c6d22..53996529a 100644 --- a/Modules/AccountKit/Sources/Extensions/RootAccount+Codable.swift +++ b/Modules/AccountKit/Sources/Extensions/RootAccount+Codable.swift @@ -9,7 +9,7 @@ public extension RootAccount { let container = try decoder.container(keyedBy: CodingKeys.self) self.id = try container.decodeIfPresent(String.self, forKey: .id) self.rootOwnerUid = try container.decode(String.self, forKey: .rootOwnerUid) - self.library = try container.decodeIfPresent(Library.self, forKey: .library) ?? Library() + self.library = try container.decode(Library.self, forKey: .library) self.createdAt = try container.decodeIfPresent(Date.self, forKey: .createdAt) self.lastEditedAt = try container.decodeIfPresent(Date.self, forKey: .lastEditedAt) } diff --git a/Modules/AccountKit/Sources/Extensions/SavedActivity+Codable.swift b/Modules/AccountKit/Sources/Extensions/SavedActivity+Codable.swift index 36a894d61..9e5ea2a89 100644 --- a/Modules/AccountKit/Sources/Extensions/SavedActivity+Codable.swift +++ b/Modules/AccountKit/Sources/Extensions/SavedActivity+Codable.swift @@ -10,19 +10,15 @@ extension SavedActivity: Codable { let container = try decoder.container(keyedBy: CodingKeys.self) self.id = try container.decodeIfPresent(String.self, forKey: .id) - self.rootOwnerUid = try container.decode(String.self, forKey: .rootOwnerUid) self.caregiverID = try container.decodeIfPresent(String.self, forKey: .caregiverID) ?? "" - self.createdAt = try container.decodeIfPresent(Timestamp.self, forKey: .createdAt)?.dateValue() - self.lastEditedAt = try container.decodeIfPresent(Timestamp.self, forKey: .lastEditedAt)?.dateValue() + self.createdAt = try container.decode(Date.self, forKey: .createdAt) } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(self.id, forKey: .id) - try container.encode(self.rootOwnerUid, forKey: .rootOwnerUid) try container.encode(self.caregiverID, forKey: .caregiverID) - try container.encodeIfPresent(self.createdAt.map { Timestamp(date: $0) }, forKey: .createdAt) - try container.encodeIfPresent(self.lastEditedAt.map { Timestamp(date: $0) }, forKey: .lastEditedAt) + try container.encode(self.createdAt, forKey: .createdAt) } } diff --git a/Modules/AccountKit/Sources/Extensions/SavedCurriculum+Codable.swift b/Modules/AccountKit/Sources/Extensions/SavedCurriculum+Codable.swift index c11ea2fe3..caba54ef8 100644 --- a/Modules/AccountKit/Sources/Extensions/SavedCurriculum+Codable.swift +++ b/Modules/AccountKit/Sources/Extensions/SavedCurriculum+Codable.swift @@ -10,19 +10,15 @@ extension SavedCurriculum: Codable { let container = try decoder.container(keyedBy: CodingKeys.self) self.id = try container.decodeIfPresent(String.self, forKey: .id) - self.rootOwnerUid = try container.decode(String.self, forKey: .rootOwnerUid) self.caregiverID = try container.decodeIfPresent(String.self, forKey: .caregiverID) ?? "" - self.createdAt = try container.decodeIfPresent(Timestamp.self, forKey: .createdAt)?.dateValue() - self.lastEditedAt = try container.decodeIfPresent(Timestamp.self, forKey: .lastEditedAt)?.dateValue() + self.createdAt = try container.decode(Date.self, forKey: .createdAt) } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(self.id, forKey: .id) - try container.encode(self.rootOwnerUid, forKey: .rootOwnerUid) try container.encode(self.caregiverID, forKey: .caregiverID) - try container.encodeIfPresent(self.createdAt.map { Timestamp(date: $0) }, forKey: .createdAt) - try container.encodeIfPresent(self.lastEditedAt.map { Timestamp(date: $0) }, forKey: .lastEditedAt) + try container.encodeIfPresent(self.createdAt, forKey: .createdAt) } } diff --git a/Modules/AccountKit/Sources/Extensions/SavedGamepad+Codable.swift b/Modules/AccountKit/Sources/Extensions/SavedGamepad+Codable.swift index aed5b8db7..b979b4ac0 100644 --- a/Modules/AccountKit/Sources/Extensions/SavedGamepad+Codable.swift +++ b/Modules/AccountKit/Sources/Extensions/SavedGamepad+Codable.swift @@ -10,19 +10,15 @@ extension SavedGamepad: Codable { let container = try decoder.container(keyedBy: CodingKeys.self) self.id = try container.decodeIfPresent(String.self, forKey: .id) - self.rootOwnerUid = try container.decode(String.self, forKey: .rootOwnerUid) self.caregiverID = try container.decodeIfPresent(String.self, forKey: .caregiverID) ?? "" - self.createdAt = try container.decodeIfPresent(Timestamp.self, forKey: .createdAt)?.dateValue() - self.lastEditedAt = try container.decodeIfPresent(Timestamp.self, forKey: .lastEditedAt)?.dateValue() + self.createdAt = try container.decode(Date.self, forKey: .createdAt) } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(self.id, forKey: .id) - try container.encode(self.rootOwnerUid, forKey: .rootOwnerUid) try container.encode(self.caregiverID, forKey: .caregiverID) - try container.encodeIfPresent(self.createdAt.map { Timestamp(date: $0) }, forKey: .createdAt) - try container.encodeIfPresent(self.lastEditedAt.map { Timestamp(date: $0) }, forKey: .lastEditedAt) + try container.encode(self.createdAt, forKey: .createdAt) } } diff --git a/Modules/AccountKit/Sources/Extensions/SavedStory+Codable.swift b/Modules/AccountKit/Sources/Extensions/SavedStory+Codable.swift index 5f93e4354..4ad7ca6d5 100644 --- a/Modules/AccountKit/Sources/Extensions/SavedStory+Codable.swift +++ b/Modules/AccountKit/Sources/Extensions/SavedStory+Codable.swift @@ -10,19 +10,15 @@ extension SavedStory: Codable { let container = try decoder.container(keyedBy: CodingKeys.self) self.id = try container.decodeIfPresent(String.self, forKey: .id) - self.rootOwnerUid = try container.decode(String.self, forKey: .rootOwnerUid) self.caregiverID = try container.decodeIfPresent(String.self, forKey: .caregiverID) ?? "" - self.createdAt = try container.decodeIfPresent(Timestamp.self, forKey: .createdAt)?.dateValue() - self.lastEditedAt = try container.decodeIfPresent(Timestamp.self, forKey: .lastEditedAt)?.dateValue() + self.createdAt = try container.decode(Date.self, forKey: .createdAt) } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(self.id, forKey: .id) - try container.encode(self.rootOwnerUid, forKey: .rootOwnerUid) try container.encode(self.caregiverID, forKey: .caregiverID) - try container.encodeIfPresent(self.createdAt.map { Timestamp(date: $0) }, forKey: .createdAt) - try container.encodeIfPresent(self.lastEditedAt.map { Timestamp(date: $0) }, forKey: .lastEditedAt) + try container.encode(self.createdAt, forKey: .createdAt) } } diff --git a/Modules/AccountKit/Sources/Managers/RootAccounts/RootAccountManager.swift b/Modules/AccountKit/Sources/Managers/RootAccounts/RootAccountManager.swift index 4d1a460e0..0da683514 100644 --- a/Modules/AccountKit/Sources/Managers/RootAccounts/RootAccountManager.swift +++ b/Modules/AccountKit/Sources/Managers/RootAccounts/RootAccountManager.swift @@ -65,7 +65,7 @@ public class RootAccountManager { return } - let savedActivity = SavedActivity(id: activityID, rootOwnerUid: rootAccount.rootOwnerUid, caregiverID: caregiverID) + let savedActivity = SavedActivity(id: activityID, caregiverID: caregiverID) guard !rootAccount.library.savedActivities.contains(where: { $0.id == activityID }) else { log.info("\(activityID) is already saved.") @@ -99,7 +99,7 @@ public class RootAccountManager { return } - let savedCurriculum = SavedCurriculum(id: curriculumID, rootOwnerUid: rootAccount.rootOwnerUid, caregiverID: caregiverID) + let savedCurriculum = SavedCurriculum(id: curriculumID, caregiverID: caregiverID) guard !rootAccount.library.savedCurriculums.contains(where: { $0.id == curriculumID }) else { log.info("\(curriculumID) is already saved.") @@ -133,7 +133,7 @@ public class RootAccountManager { return } - let savedStory = SavedStory(id: storyID, rootOwnerUid: rootAccount.rootOwnerUid, caregiverID: caregiverID) + let savedStory = SavedStory(id: storyID, caregiverID: caregiverID) guard !rootAccount.library.savedStories.contains(where: { $0.id == storyID }) else { log.info("\(storyID) is already saved.") @@ -167,7 +167,7 @@ public class RootAccountManager { return } - let savedGamepad = SavedGamepad(id: gamepadID, rootOwnerUid: rootAccount.rootOwnerUid, caregiverID: caregiverID) + let savedGamepad = SavedGamepad(id: gamepadID, caregiverID: caregiverID) guard !rootAccount.library.savedGamepads.contains(where: { $0.id == gamepadID }) else { log.info("\(gamepadID) is already saved.") diff --git a/Modules/AccountKit/Sources/Models/RootAccount/Library/Library+Init.swift b/Modules/AccountKit/Sources/Models/RootAccount/Library/Library+Init.swift deleted file mode 100644 index e48840d0d..000000000 --- a/Modules/AccountKit/Sources/Models/RootAccount/Library/Library+Init.swift +++ /dev/null @@ -1,25 +0,0 @@ -// Leka - iOS Monorepo -// Copyright APF France handicap -// SPDX-License-Identifier: Apache-2.0 - -import SwiftUI - -public extension Library { - init( - id: String? = nil, - rootOwnerUid: String = "", - savedActivities: [SavedActivity] = [], - savedCurriculums: [SavedCurriculum] = [], - savedStories: [SavedStory] = [], - savedGamepads: [SavedGamepad] = [] - ) { - self.id = id - self.rootOwnerUid = rootOwnerUid - self.savedActivities = savedActivities - self.savedCurriculums = savedCurriculums - self.savedStories = savedStories - self.savedGamepads = savedGamepads - self.createdAt = nil - self.lastEditedAt = nil - } -} diff --git a/Modules/AccountKit/Sources/Models/RootAccount/Library/Library.swift b/Modules/AccountKit/Sources/Models/RootAccount/Library/Library.swift index 8d42ae7e6..243726132 100644 --- a/Modules/AccountKit/Sources/Models/RootAccount/Library/Library.swift +++ b/Modules/AccountKit/Sources/Models/RootAccount/Library/Library.swift @@ -7,14 +7,23 @@ import SwiftUI // MARK: - SavedActivity -public struct Library: DatabaseDocument, Hashable { - // MARK: Public +public struct Library: Hashable { + // MARK: Lifecycle + + public init( + savedActivities: [SavedActivity] = [], + savedCurriculums: [SavedCurriculum] = [], + savedStories: [SavedStory] = [], + savedGamepads: [SavedGamepad] = [] + ) { + self.savedActivities = savedActivities + self.savedCurriculums = savedCurriculums + self.savedStories = savedStories + self.savedGamepads = savedGamepads + } - @ServerTimestamp public var createdAt: Date? - @ServerTimestamp public var lastEditedAt: Date? + // MARK: Public - public var id: String? - public var rootOwnerUid: String public var savedActivities: [SavedActivity] public var savedCurriculums: [SavedCurriculum] public var savedStories: [SavedStory] @@ -23,13 +32,9 @@ public struct Library: DatabaseDocument, Hashable { // MARK: Internal enum CodingKeys: String, CodingKey { - case id = "uuid" - case rootOwnerUid = "root_owner_uid" case savedActivities = "saved_activities" case savedCurriculums = "saved_curriculums" case savedStories = "saved_stories" case savedGamepads = "saved_gamepads" - case createdAt = "created_at" - case lastEditedAt = "last_edited_at" } } diff --git a/Modules/AccountKit/Sources/Models/RootAccount/Library/SavedActivity/SavedActivity+Init.swift b/Modules/AccountKit/Sources/Models/RootAccount/Library/SavedActivity/SavedActivity+Init.swift index 214cc614a..a74d3d0a6 100644 --- a/Modules/AccountKit/Sources/Models/RootAccount/Library/SavedActivity/SavedActivity+Init.swift +++ b/Modules/AccountKit/Sources/Models/RootAccount/Library/SavedActivity/SavedActivity+Init.swift @@ -7,13 +7,10 @@ import SwiftUI public extension SavedActivity { init( id: String? = nil, - rootOwnerUid: String = "", caregiverID: String ) { self.id = id - self.rootOwnerUid = rootOwnerUid self.caregiverID = caregiverID - self.createdAt = nil - self.lastEditedAt = nil + self.createdAt = Date() } } diff --git a/Modules/AccountKit/Sources/Models/RootAccount/Library/SavedActivity/SavedActivity.swift b/Modules/AccountKit/Sources/Models/RootAccount/Library/SavedActivity/SavedActivity.swift index daa1368a3..a4a48e423 100644 --- a/Modules/AccountKit/Sources/Models/RootAccount/Library/SavedActivity/SavedActivity.swift +++ b/Modules/AccountKit/Sources/Models/RootAccount/Library/SavedActivity/SavedActivity.swift @@ -7,23 +7,18 @@ import SwiftUI // MARK: - SavedActivity -public struct SavedActivity: DatabaseDocument, Hashable { +public struct SavedActivity: Hashable { // MARK: Public - @ServerTimestamp public var createdAt: Date? - @ServerTimestamp public var lastEditedAt: Date? - public var id: String? - public var rootOwnerUid: String public var caregiverID: String + public var createdAt: Date // MARK: Internal enum CodingKeys: String, CodingKey { case id = "uuid" - case rootOwnerUid = "root_owner_uid" case caregiverID = "caregiver_id" case createdAt = "created_at" - case lastEditedAt = "last_edited_at" } } diff --git a/Modules/AccountKit/Sources/Models/RootAccount/Library/SavedCurriculum/SavedCurriculum+Init.swift b/Modules/AccountKit/Sources/Models/RootAccount/Library/SavedCurriculum/SavedCurriculum+Init.swift index 98fb58c8e..844066077 100644 --- a/Modules/AccountKit/Sources/Models/RootAccount/Library/SavedCurriculum/SavedCurriculum+Init.swift +++ b/Modules/AccountKit/Sources/Models/RootAccount/Library/SavedCurriculum/SavedCurriculum+Init.swift @@ -7,13 +7,10 @@ import SwiftUI public extension SavedCurriculum { init( id: String? = nil, - rootOwnerUid: String = "", caregiverID: String ) { self.id = id - self.rootOwnerUid = rootOwnerUid self.caregiverID = caregiverID - self.createdAt = nil - self.lastEditedAt = nil + self.createdAt = Date() } } diff --git a/Modules/AccountKit/Sources/Models/RootAccount/Library/SavedCurriculum/SavedCurriculum.swift b/Modules/AccountKit/Sources/Models/RootAccount/Library/SavedCurriculum/SavedCurriculum.swift index 70a5bc283..4fc2a7f7f 100644 --- a/Modules/AccountKit/Sources/Models/RootAccount/Library/SavedCurriculum/SavedCurriculum.swift +++ b/Modules/AccountKit/Sources/Models/RootAccount/Library/SavedCurriculum/SavedCurriculum.swift @@ -7,23 +7,18 @@ import SwiftUI // MARK: - SavedCurriculum -public struct SavedCurriculum: DatabaseDocument, Hashable { +public struct SavedCurriculum: Hashable { // MARK: Public - @ServerTimestamp public var createdAt: Date? - @ServerTimestamp public var lastEditedAt: Date? - public var id: String? - public var rootOwnerUid: String public var caregiverID: String + public var createdAt: Date // MARK: Internal enum CodingKeys: String, CodingKey { case id = "uuid" - case rootOwnerUid = "root_owner_uid" case caregiverID = "caregiver_id" case createdAt = "created_at" - case lastEditedAt = "last_edited_at" } } diff --git a/Modules/AccountKit/Sources/Models/RootAccount/Library/SavedGamepad/SavedGamepad+Init.swift b/Modules/AccountKit/Sources/Models/RootAccount/Library/SavedGamepad/SavedGamepad+Init.swift index 6283d4620..2a2bb575b 100644 --- a/Modules/AccountKit/Sources/Models/RootAccount/Library/SavedGamepad/SavedGamepad+Init.swift +++ b/Modules/AccountKit/Sources/Models/RootAccount/Library/SavedGamepad/SavedGamepad+Init.swift @@ -7,13 +7,10 @@ import SwiftUI public extension SavedGamepad { init( id: String? = nil, - rootOwnerUid: String = "", caregiverID: String ) { self.id = id - self.rootOwnerUid = rootOwnerUid self.caregiverID = caregiverID - self.createdAt = nil - self.lastEditedAt = nil + self.createdAt = Date() } } diff --git a/Modules/AccountKit/Sources/Models/RootAccount/Library/SavedGamepad/SavedGamepad.swift b/Modules/AccountKit/Sources/Models/RootAccount/Library/SavedGamepad/SavedGamepad.swift index 124371f39..bc5b0cab7 100644 --- a/Modules/AccountKit/Sources/Models/RootAccount/Library/SavedGamepad/SavedGamepad.swift +++ b/Modules/AccountKit/Sources/Models/RootAccount/Library/SavedGamepad/SavedGamepad.swift @@ -7,23 +7,18 @@ import SwiftUI // MARK: - SavedGamepad -public struct SavedGamepad: DatabaseDocument, Hashable { +public struct SavedGamepad: Hashable { // MARK: Public - @ServerTimestamp public var createdAt: Date? - @ServerTimestamp public var lastEditedAt: Date? - public var id: String? - public var rootOwnerUid: String public var caregiverID: String + public var createdAt: Date // MARK: Internal enum CodingKeys: String, CodingKey { case id = "uuid" - case rootOwnerUid = "root_owner_uid" case caregiverID = "caregiver_id" case createdAt = "created_at" - case lastEditedAt = "last_edited_at" } } diff --git a/Modules/AccountKit/Sources/Models/RootAccount/Library/SavedStory/SavedStory+Init.swift b/Modules/AccountKit/Sources/Models/RootAccount/Library/SavedStory/SavedStory+Init.swift index c81705b00..76c9fbfc6 100644 --- a/Modules/AccountKit/Sources/Models/RootAccount/Library/SavedStory/SavedStory+Init.swift +++ b/Modules/AccountKit/Sources/Models/RootAccount/Library/SavedStory/SavedStory+Init.swift @@ -7,13 +7,10 @@ import SwiftUI public extension SavedStory { init( id: String? = nil, - rootOwnerUid: String = "", caregiverID: String ) { self.id = id - self.rootOwnerUid = rootOwnerUid self.caregiverID = caregiverID - self.createdAt = nil - self.lastEditedAt = nil + self.createdAt = Date() } } diff --git a/Modules/AccountKit/Sources/Models/RootAccount/Library/SavedStory/SavedStory.swift b/Modules/AccountKit/Sources/Models/RootAccount/Library/SavedStory/SavedStory.swift index 6e5d7aa53..d0e2661c3 100644 --- a/Modules/AccountKit/Sources/Models/RootAccount/Library/SavedStory/SavedStory.swift +++ b/Modules/AccountKit/Sources/Models/RootAccount/Library/SavedStory/SavedStory.swift @@ -7,23 +7,18 @@ import SwiftUI // MARK: - SavedStory -public struct SavedStory: DatabaseDocument, Hashable { +public struct SavedStory: Hashable { // MARK: Public - @ServerTimestamp public var createdAt: Date? - @ServerTimestamp public var lastEditedAt: Date? - public var id: String? - public var rootOwnerUid: String public var caregiverID: String + public var createdAt: Date // MARK: Internal enum CodingKeys: String, CodingKey { case id = "uuid" - case rootOwnerUid = "root_owner_uid" case caregiverID = "caregiver_id" case createdAt = "created_at" - case lastEditedAt = "last_edited_at" } } diff --git a/Modules/AccountKit/Sources/Models/RootAccount/RootAccount+Init.swift b/Modules/AccountKit/Sources/Models/RootAccount/RootAccount+Init.swift index 87e8afa00..ce63e9363 100644 --- a/Modules/AccountKit/Sources/Models/RootAccount/RootAccount+Init.swift +++ b/Modules/AccountKit/Sources/Models/RootAccount/RootAccount+Init.swift @@ -7,11 +7,10 @@ import SwiftUI public extension RootAccount { init( id: String = "", - rootOwnerUid: String = "", - library: Library = Library() + rootOwnerUid: String = "" ) { self.id = id self.rootOwnerUid = rootOwnerUid - self.library = library + self.library = Library() } }