diff LazyBear/Views/Company/Chart.swift @ 405:fd8df65927e9

Implementing CapsuleChart in insiders
author Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
date Sat, 05 Jun 2021 19:04:44 +0200
parents 8357b101df67
children c804ce7a1560
line wrap: on
line diff
--- a/LazyBear/Views/Company/Chart.swift	Thu Jun 03 16:05:01 2021 +0200
+++ b/LazyBear/Views/Company/Chart.swift	Sat Jun 05 19:04:44 2021 +0200
@@ -24,7 +24,7 @@
             VStack {
                 DatePicker(ranges: ranges, selectedRange: $selectedRange)
                     .onChange(of: selectedRange, perform: { range in
-                        let url = "https://api.lazybear.app/company/chart/type=refresh/symbol=\(symbol)/range=\(range.lowercased())"
+                        let url = "https://api.lazybear.app/company/chart/symbol=\(symbol)/type=refresh/range=\(range.lowercased())"
                         company.request(url, .refresh, "chart")
                     })
                 
@@ -68,12 +68,12 @@
             .onAppear { self.timer = Timer.publish(every: 10, on: .main, in: .common).autoconnect() }  // Start timer
             .onDisappear { self.timer.upstream.connect().cancel() }  // Stop timer
             .onReceive(timer) { _ in
-                let url = "https://api.lazybear.app/company/chart/type=streaming/symbol=\(symbol)"
+                let url = "https://api.lazybear.app/company/chart/symbol=\(symbol)/type=streaming"
                 company.request(url, .streaming, "chart") }  // Receive timer notification
         } else {
             ProgressView()
                 .onAppear {
-                    let url = "https://api.lazybear.app/company/chart/type=init/symbol=\(symbol)"
+                    let url = "https://api.lazybear.app/company/chart/symbol=\(symbol)/type=init"
                     company.request(url, .initial, "chart")
                 }
         }