File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
NativeAppTemplate/Data/Repositories Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -64,10 +64,12 @@ import SwiftUI
6464 do {
6565 let itemTag = try await itemTagsService. itemTagDetail ( id: id)
6666 let itemTagIndex = ( itemTags. firstIndex { $0. id == itemTag. id } )
67- if itemTagIndex != nil {
67+ if itemTagIndex == nil {
68+ itemTags. append ( itemTag)
69+ } else {
6870 itemTags [ itemTagIndex!] = itemTag
6971 }
70-
72+
7173 return itemTag
7274 } catch {
7375 Failure
Original file line number Diff line number Diff line change @@ -56,10 +56,12 @@ import SwiftUI
5656 do {
5757 let shop = try await shopsService. shopDetail ( id: id)
5858 let shopIndex = ( shops. firstIndex { $0. id == shop. id } )
59- if shopIndex != nil {
59+ if shopIndex == nil {
60+ shops. append ( shop)
61+ } else {
6062 shops [ shopIndex!] = shop
6163 }
62-
64+
6365 return shop
6466 } catch {
6567 Failure
You can’t perform that action at this time.
0 commit comments