[PR] Merge back to main branch
[PR] Merge back to main branch
This commit is contained in:
@@ -87,6 +87,7 @@ class LoginVC: UIViewController
|
|||||||
let errors = ["409 - [\"A0111\"]": "Account already exists, please login instead.",
|
let errors = ["409 - [\"A0111\"]": "Account already exists, please login instead.",
|
||||||
"401 -": "Incorrect username/password",
|
"401 -": "Incorrect username/password",
|
||||||
"404 -": "Username does not exist in the database",
|
"404 -": "Username does not exist in the database",
|
||||||
|
"406 - [\"A0101\"]": "Username invalid."
|
||||||
]
|
]
|
||||||
|
|
||||||
// Send register request
|
// Send register request
|
||||||
|
|||||||
@@ -73,13 +73,13 @@ class AlarmTableCell: UITableViewCell
|
|||||||
time.text = alarm.minute < 10 ? "\(hour):0\(alarm.minute)" : "\(hour):\(alarm.minute)"
|
time.text = alarm.minute < 10 ? "\(hour):0\(alarm.minute)" : "\(hour):\(alarm.minute)"
|
||||||
|
|
||||||
// displays the specific days alarm is activated
|
// displays the specific days alarm is activated
|
||||||
let daysDict = [0: "Mon", 1: "Tues", 2: "Wed", 3: "Thurs", 4: "Fri", 5: "Sat", 6: "Sun"]
|
let daysDict = ["Sun", "Mon", "Tues", "Wed", "Thurs", "Fri", "Sat"]
|
||||||
var daysActive : [String] = []
|
var daysActive : [String] = []
|
||||||
if alarm.oneTime {repeatText.text = "No Repeat"}
|
if alarm.oneTime {repeatText.text = "No Repeat"}
|
||||||
else {
|
else {
|
||||||
for (index, element) in alarm.repeats.enumerated() {
|
for (index, element) in alarm.repeats.enumerated() {
|
||||||
if element {
|
if element {
|
||||||
daysActive.append(daysDict[index] ?? "")
|
daysActive.append(daysDict[index])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
repeatText.text = daysActive.joined(separator: ", ")
|
repeatText.text = daysActive.joined(separator: ", ")
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
/// Base URL of the HTTP server
|
/// Base URL of the HTTP server
|
||||||
let baseUrl = "http://localhost:8080" // TODO: Production settings
|
let baseUrl = "https://alarm-clock-api.hydev.org"
|
||||||
|
|
||||||
/// Json class
|
/// Json class
|
||||||
class JSON
|
class JSON
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ class TestingViewController: UIViewController
|
|||||||
@IBAction func addAlarm(_ sender: Any)
|
@IBAction func addAlarm(_ sender: Any)
|
||||||
{
|
{
|
||||||
let (h, m, _) = Date().getHMS()
|
let (h, m, _) = Date().getHMS()
|
||||||
Alarms.fromLocal().apply { $0.list.append(Alarm(hour: h, minute: m, text: "Test alarm - \(h * m)", wakeMethod: wvms[1], lastActivate: Date().added(.minute, -1))) }.localSave()
|
Alarms.fromLocal().apply { $0.list.append(Alarm(hour: h, minute: m, text: "Test alarm - \(h * m)", wakeMethod: wvms[1], repeats: [true, true, true, true, true, true, true], oneTime: true, lastActivate: Date().added(.minute, -1))) }.localSave()
|
||||||
}
|
}
|
||||||
|
|
||||||
@IBAction func deleteAlarm(_ sender: Any)
|
@IBAction func deleteAlarm(_ sender: Any)
|
||||||
|
|||||||
Reference in New Issue
Block a user