Add useResource hook for fetching resource data
Add Support or authenticating using OIDC
This commit is contained in:
parent
0e0c43c4f5
commit
bd49f4314d
5 changed files with 265 additions and 64 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue