-
Notifications
You must be signed in to change notification settings - Fork 147
Conversation
djenriquez
commented
Nov 9, 2016
- Allow tokens with respective access to perform CRUD operations against policies
|
||
axios.put(`/policy?vaultaddr=${encodeURI(window.localStorage.getItem("vaultUrl"))}&policy=${encodeURI(policyName)}&token=${encodeURI(window.localStorage.getItem("vaultAccessToken"))}`, { "Policy": this.state.currentPolicy }) | ||
.then((resp) => { | ||
if (resp.status === 200) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the point of this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
placeholder, removed the 200 check though
} | ||
|
||
updatePolicy() { | ||
let policyName = `${this.state.editingPolicy}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for interpolation here
// Attempt to parse into JSON incase a stringified JSON was sent | ||
try { | ||
policy = JSON.parse(policy) | ||
} catch(e) { } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should log these errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its not meant to be an error, rather a check if the string is a valid json, and if it is, make it an object
res.json(resp.data); | ||
}) | ||
.catch((err) => { | ||
//console.error(err); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this