Skip to content

Commit

Permalink
Merge pull request #597 from HackIllinois/chahit/eventUserAPI
Browse files Browse the repository at this point in the history
Fixed user event API endpoint
  • Loading branch information
cj-innit-07 authored Nov 18, 2024
2 parents c894e50 + b797647 commit c9c9508
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions HIAPI/Services/UserService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,15 @@ public final class UserService: BaseService {
public static func favoriteEvent(userToken: String, eventID: String) -> APIRequest<FollowStatus> {
var authorizationHeaders = HTTPHeaders()
authorizationHeaders["Authorization"] = userToken
var body = HTTPBody()
body["eventId"] = eventID
return APIRequest<FollowStatus>(service: self, endpoint: "follow/", body: body, headers: authorizationHeaders, method: .PUT)
let endpoint = "follow/\(eventID)/"
return APIRequest<FollowStatus>(service: self, endpoint: endpoint, headers: authorizationHeaders, method: .PUT)
}

public static func unfavoriteEvent(userToken: String, eventID: String) -> APIRequest<FollowStatus> {
var authorizationHeaders = HTTPHeaders()
authorizationHeaders["Authorization"] = userToken
var body = HTTPBody()
body["eventId"] = eventID
return APIRequest<FollowStatus>(service: self, endpoint: "unfollow/", body: body, headers: authorizationHeaders, method: .PUT)
let endpoint = "unfollow/\(eventID)/"
return APIRequest<FollowStatus>(service: self, endpoint: endpoint, headers: authorizationHeaders, method: .DELETE)
}

public static func userScanEvent(userToken: String, eventID: String) -> APIRequest<UserCheckInStatus> {
Expand Down

0 comments on commit c9c9508

Please sign in to comment.