Skip to content

Commit

Permalink
fix token const
Browse files Browse the repository at this point in the history
Signed-off-by: Musilah <[email protected]>
  • Loading branch information
Musilah committed Apr 9, 2024
1 parent 1cd4117 commit 7fbf1b4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
10 changes: 6 additions & 4 deletions examples/certs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ const mySdk = new SDK({
certsUrl: defaultUrl + ':9019'
})

const token = '<token>'

mySdk.certs
.IssueCert(
'<thingID>',
'<valid>',
'<token>'
token
)
.then((response: any) => {
console.log('response: ', response)
Expand All @@ -22,7 +24,7 @@ mySdk.certs
mySdk.certs
.ViewCertByThing(
'<thingID>',
'<token>'
token
)
.then((response: any) => {
console.log('response: ', response)
Expand All @@ -34,7 +36,7 @@ mySdk.certs
mySdk.certs
.ViewCert(
'<certID>',
'<token>'
token
)
.then((response: any) => {
console.log('response: ', response)
Expand All @@ -46,7 +48,7 @@ mySdk.certs
mySdk.certs
.RevokeCert(
'<thingID>',
'<token>'
token
)
.then((response: any) => {
console.log('response: ', response)
Expand Down
12 changes: 6 additions & 6 deletions src/certs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ export default class Certs {
const errorRes = await response.json()
throw this.certsError.HandleError(errorRes.error, response.status)
}
const certsData: Cert = await response.json()
return certsData
const cert: Cert = await response.json()
return cert
} catch (error) {
throw error
}
Expand Down Expand Up @@ -95,8 +95,8 @@ export default class Certs {
const errorRes = await response.json()
throw this.certsError.HandleError(errorRes.error, response.status)
}
const certsData: CertSerials = await response.json()
return certsData
const certsPage: CertSerials = await response.json()
return certsPage
} catch (error) {
throw error
}
Expand Down Expand Up @@ -129,8 +129,8 @@ export default class Certs {
const errorRes = await response.json()
throw this.certsError.HandleError(errorRes.error, response.status)
}
const certsData: Cert = await response.json()
return certsData
const cert: Cert = await response.json()
return cert
} catch (error) {
throw error
}
Expand Down

0 comments on commit 7fbf1b4

Please sign in to comment.