import { OCCUSPACE_API_URL_MOCK } from '../AppSettings'

const OccuspaceService = {
	FetchOccuspace() {
		return fetch(OCCUSPACE_API_URL_MOCK)
			.then(response => response.json())
			.then(responseData => responseData)
			.catch((err) => {
				console.log('Error fetching occuspace data: ' + err)
				return null
			})
	},
}

export default OccuspaceService
@@ -48,16 +48,69 @@
 ettings'
+%0Aimport %7B authorizedPublicFetch %7D from '../util/auth'
 %0A%0Aconst 
@@ -131,16 +131,18 @@
 ce = %7B%0A%09
+* 
 FetchOcc
@@ -158,221 +158,151 @@
 %7B%0A%09%09
-return fetch(OCCUSPACE_API_URL_MOCK)%0A%09%09%09.then(response =%3E response.json())%0A%09%09%09.then(responseData =%3E responseD
+try %7B%0A%09%09%09const data = (yield authorizedPublicFetch(OCCUSPACE_API_URL_MOCK + '/busyness'))%0A%09%09%09return d
 ata
-)
 %0A%09%09
-%09.
+%7D 
 catch
-(
+ 
 (err
-) =%3E %7B%0A%09%09%09%09console.log('Error fetching occuspace data: ' + err)%0A%09%09%09%09return null%0A%09
+or) %7B%0A%09%09%09throw error%0A
 %09%09%7D
-)
 %0A%09%7D,

update occuspaceService to fetch live data from wso2 using the new authorizedPublicFetch method