Skip to content

Commit 9f475f4

Browse files
committed
[feat] #208 amplitude - 폴더 생성, 링크 저장 완료
1 parent de4cec7 commit 9f475f4

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

Projects/CoreKit/Sources/Data/Network/Category/CategoryClient+LiveKey.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import Moya
1212

1313
extension CategoryClient: DependencyKey {
1414
public static let liveValue: Self = {
15+
@Dependency(\.amplitude.track) var amplitudeTrack
1516
let provider = MoyaProvider<CategoryEndpoint>.build()
1617

1718
return Self(
@@ -31,7 +32,10 @@ extension CategoryClient: DependencyKey {
3132
)
3233
},
3334
카테고리_생성: { model in
34-
try await provider.request(.카테고리생성(model: model))
35+
let response: CategoryEditResponse
36+
response = try await provider.request(.카테고리생성(model: model))
37+
amplitudeTrack(.add_folder(folderName: response.categoryName))
38+
return response
3539
},
3640
카테고리_프로필_목록_조회: {
3741
try await provider.request(.카테고리_프로필_목록_조회)

Projects/CoreKit/Sources/Data/Network/Content/ContentClient+LiveKey.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ import Moya
1010

1111
extension ContentClient: DependencyKey {
1212
public static let liveValue: Self = {
13+
@Dependency(\.amplitude.track) var amplitudeTrack
1314
let provider = MoyaProvider<ContentEndpoint>.build()
14-
15+
1516
return Self(
1617
컨텐츠_삭제: { id in
1718
try await provider.requestNoBody(.컨텐츠_삭제(contentId: id))
@@ -23,7 +24,13 @@ extension ContentClient: DependencyKey {
2324
try await provider.request(.컨텐츠_수정(contentId: id, model: model))
2425
},
2526
컨텐츠_추가: { model in
26-
try await provider.request(.컨텐츠_추가(model: model))
27+
let response: ContentDetailResponse
28+
response = try await provider.request(.컨텐츠_추가(model: model))
29+
amplitudeTrack(.add_link(
30+
folderId: "\(response.category.categoryId)",
31+
linkDomain: response.data
32+
))
33+
return response
2734
},
2835
즐겨찾기: { id in
2936
try await provider.request(.즐겨찾기(contentId: id))

0 commit comments

Comments
 (0)