Skip to content

Commit

Permalink
[Fix] sopt-makers#199 - url path 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
0inn committed Apr 22, 2023
1 parent f2a2420 commit 556c05f
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public enum AttendanceAPI {
case score
case total
case lectureRound(lectureId: Int)
case attend(lectureRoundId: Int, code: Int)
case attend(lectureRoundId: Int, code: String)
}

extension AttendanceAPI: BaseAPI {
Expand All @@ -26,7 +26,7 @@ extension AttendanceAPI: BaseAPI {
// MARK: - Header
public var headers: [String: String]? {
switch self {
case .lecture, .score, .total:
case .lecture, .score, .total, .lectureRound, .attend:
return HeaderType.jsonWithToken.value
default: return HeaderType.json.value
}
Expand All @@ -38,13 +38,13 @@ extension AttendanceAPI: BaseAPI {
case .lecture:
return "lecture"
case .score:
return "score"
return "members/score"
case .total:
return "total"
case .lectureRound(let lectureId):
return "lecture/round/\(lectureId)"
return "lectures/round/\(lectureId)"
case .attend:
return "attend"
return "attendances/attend"
}
}

Expand Down Expand Up @@ -81,6 +81,8 @@ extension AttendanceAPI: BaseAPI {

public var task: Task {
switch self {
case .attend:
return .requestParameters(parameters: bodyParameters ?? [:], encoding: parameterEncoding)
default:
return .requestPlain
}
Expand Down

0 comments on commit 556c05f

Please sign in to comment.