TFT: Tilt has a button that allows user to create a snapshot and share the link#2054
Merged
Conversation
dummy handlefunc for handle new snapshot HUD server passes along payload With tests dummy "get link" button on topbar create state object in ts button console prints entire state sendSnapshot function that sends ...snapshot/adding TODO comments run make wire made snapshot type different than hud state (deleted alertlinks)/ran prettier handlesnapshot() returns snapshot URL in json button opens up a new tab with URL button does fancy URL thing fix snapshot test to use fake client merge w master add test for snapshot + add snap json file dummy handlefunc for handle new snapshot HUD server passes along payload With tests dummy "get link" button on topbar button console prints entire state run make wire made snapshot type different than hud state (deleted alertlinks)/ran prettier handlesnapshot() returns snapshot URL in json button opens up a new tab with URL fix snapshot test to use fake client
jazzdan
reviewed
Aug 13, 2019
| return | ||
| } | ||
|
|
||
| request, err := http.NewRequest(http.MethodPost, "https://alerts.tilt.dev/api/snapshot/new", req.Body) // New request |
Contributor
There was a problem hiding this comment.
Suggested change
| request, err := http.NewRequest(http.MethodPost, "https://alerts.tilt.dev/api/snapshot/new", req.Body) // New request | |
| request, err := http.NewRequest(http.MethodPost, "https://alerts.tilt.dev/api/snapshot/new", req.Body) |
| method: "post", | ||
| body: JSON.stringify(snapshot), | ||
| }) | ||
| .then(res => { |
Contributor
There was a problem hiding this comment.
I think this promise could be re-written more idiomatically as:
fetch()
.then(res => res.json)
.then((value: NewSnapshotResponse) => {
this.setState({
SnapshotLink: value.url,
})
})
.catch(err => console.error(err)then the same catch will handle everything.
jazzdan
approved these changes
Aug 13, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
finally works end to end ! 😎