Add useResource hook for fetching resource data

Add Support or authenticating using OIDC
This commit is contained in:
Mo Tarbin 2025-02-06 19:35:33 -05:00
parent 0e0c43c4f5
commit bd49f4314d
5 changed files with 265 additions and 64 deletions

View file

@ -375,6 +375,15 @@ const GetLabels = async () => {
return resp.json()
}
const GetResource = async () => {
const basedURL = apiManager.getApiURL()
const resp = await fetch(`${basedURL}/resource`, {
method: 'GET',
headers: HEADERS(),
})
return resp.json()
}
const UpdateLabel = label => {
return Fetch(`/labels`, {
method: 'PUT',
@ -430,7 +439,6 @@ const RedeemPoints = (userId, points, circleID) => {
body: JSON.stringify({ points, userId }),
})
}
const RefreshToken = () => {
const basedURL = apiManager.getApiURL()
return fetch(`${basedURL}/auth/refresh`, {
@ -481,6 +489,7 @@ export {
GetCircleMemberRequests,
GetLabels,
GetLongLiveTokens,
GetResource,
GetSubscriptionSession,
GetThingHistory,
GetThings,