Skip to content

Commit e87eee3

Browse files
committed
feat: add FavoriteGroup initializer by updatable values
1 parent 98755ee commit e87eee3

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Sources/VRCKit/Models/Favorite/FavoriteGroupModel.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,21 @@ public struct FavoriteGroup: Codable, Sendable, Identifiable, Hashable {
2222
}
2323
}
2424

25+
public extension FavoriteGroup {
26+
/// Initialize by updatable values
27+
init(source: FavoriteGroup, displayName: String, visibility: Visibility) {
28+
self.init(
29+
id: source.id,
30+
displayName: displayName,
31+
name: source.name,
32+
ownerId: source.ownerId,
33+
tags: source.tags,
34+
type: source.type,
35+
visibility: visibility
36+
)
37+
}
38+
}
39+
2540
@MemberwiseInit
2641
struct RequestToUpdateFavoriteGroup: Codable, Sendable {
2742
let displayName: String?

0 commit comments

Comments
 (0)