Skip to content

Commit

Permalink
[Feat] Keyneez#46 - contentAPI postLikeContent μž‘μ„±
Browse files Browse the repository at this point in the history
  • Loading branch information
kpk0616 committed Jan 13, 2023
1 parent df94cb4 commit b14ac94
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Keyneez/Keyneez/Global/NetworkLayer/ContentAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ enum ContentAPI {
case getAllContents(token: String)
case getDetailContent(token: String, contentId: Int)
case getSearchContent(token: String, keyword: String)
case postLikeContent
case postLikeContent(token: String, contentId: Int)
case getLikedContent(token: String)
}

Expand Down Expand Up @@ -54,8 +54,8 @@ extension ContentAPI: TargetType {
return .requestPlain
case .getSearchContent(_, let keyword):
return .requestParameters(parameters: ["keyword": keyword], encoding: URLEncoding.queryString)
case .postLikeContent:
return .requestPlain
case .postLikeContent(_, let contentId):
return .requestParameters(parameters: ["content_id": contentId], encoding: JSONEncoding.default)
case .getLikedContent:
return .requestPlain
}
Expand All @@ -66,7 +66,8 @@ extension ContentAPI: TargetType {
case .getAllContents(let token),
.getSearchContent(let token, _),
.getDetailContent(let token, _),
.getLikedContent(let token):
.getLikedContent(let token),
.postLikeContent(let token, _):
return ["Content-Type": "application/json", "Authorization": token]
default:
return nil
Expand Down

0 comments on commit b14ac94

Please sign in to comment.