P0: Fix variable shadowing in ClubService.createClub/updateClub and
ChallengeService.createChallenge/updateChallenge — renamed local
'var request' to 'var urlRequest' so JSONEncoder encodes the
typed parameter, not the URLRequest.
P1: Wire CreateClubSheet and CreateChallengeSheet to parent ViewModel —
sheets now receive viewModel and call createClub/createChallenge
before dismissing.
P2: Extract HTTPMethod enum to shared Utils/HTTPMethod.swift (was
defined in NotificationService). Remove dead 'body' parameter from
buildRequest in all three services. Add error alert UI to
ClubsView and ChallengesView.
P3: Replace forced URL unwrap with static let defaultBaseURL in all
three services. Fix MockChallengeService.updateChallenge to track
updateCalled instead of always throwing notFound.
Co-Authored-By: Paperclip <noreply@paperclip.ing>
9 lines
143 B
Swift
9 lines
143 B
Swift
import Foundation
|
|
|
|
enum HTTPMethod: String {
|
|
case get = "GET"
|
|
case post = "POST"
|
|
case patch = "PATCH"
|
|
case delete = "DELETE"
|
|
}
|