This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"interval_data": { | |
"Ascending": [ | |
{ | |
"root":"A2", | |
"m2": "Bb2", | |
"M2": "B2", | |
"m3": "C3", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
URL_STRING = "https://lineopener2.herokuapp.com/api" | |
///////////////SignUp/////////////// | |
ENDPOINT: "URL_STRING/register" | |
REQUEST: | |
signupRequest(email:String, password:String) | |
let stripe_version = STPSDKVersion | |
request.httpMethod = "POST" | |
request.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST /api/register | |
Register a user or login an existing user. Send along `email` and `password`. A new user won't be created if a user already has that email. You'll get back an `api_token` to use for requests that need authorization. | |
POST /api/stripe_token | |
For Stripe SDK to get the token it needs to approve a charge. Send along `stripe_version` and get back the JSON for the key or an error. | |
GET /api/venues |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Venue: Codable, Equatable { | |
static func ==(lhs: Venue, rhs: Venue) -> Bool { | |
return | |
lhs.longitude == rhs.longitude && | |
lhs.latitude == rhs.latitude && | |
lhs.id == rhs.id && | |
lhs.tax_rate == rhs.tax_rate && | |
lhs.name == rhs.name && |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Venue: Codable, Equatable { | |
static func ==(lhs: Venue, rhs: Venue) -> Bool { | |
return | |
lhs.longitude == rhs.longitude && | |
lhs.latitude == rhs.latitude && | |
lhs.venue_id == rhs.venue_id && | |
lhs.venue_tax_rate == rhs.venue_tax_rate && | |
lhs.name == rhs.name && |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Login | |
Login { | |
let email: String | |
let fb_id: String //when fb is implemented | |
let password: String | |
let password_reset_code: String | |
let phone_number: String | |
let user_id: String | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct PlacesData: Codable { | |
let data: [Place] | |
// let msg: String | |
// let status: Int | |
// let statuscode: Int | |
} | |
struct Place: Codable, Equatable { | |
static func ==(lhs: Place, rhs: Place) -> Bool { | |
return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct PlacesData: Codable { | |
let data: [Place] | |
let msg: String | |
let status: Int | |
let statuscode: Int | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct VenueListData: Codable { | |
let data: [VenueList] | |
let msg: String | |
let status: Int | |
let statuscode: Int | |
} | |
struct VenueList: Codable { | |
let venue_id: String | |
let place_id: String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class func getHomeScreenPlaceList(completion: @escaping ((Result<VenueData>) -> Void)) { | |
guard let url = URL(string: "\(URL_STRING)/places") else { return } | |
let defaults = UserDefaults.standard | |
let token = defaults.object(forKey: "token") as? String | |
let tokenHeaderString = "Token \(token)" | |
var request = URLRequest(url: url) | |
request.httpMethod = "GET" | |
request.addValue("application/json", forHTTPHeaderField: "Content-Type") |
NewerOlder