Index: experimental/webtry/webtry.go |
diff --git a/experimental/webtry/webtry.go b/experimental/webtry/webtry.go |
index 73b1ae598af110ad94728223d5e9ab5036b966c1..a895b0117843088b2785d4d45639ea7db53249d7 100644 |
--- a/experimental/webtry/webtry.go |
+++ b/experimental/webtry/webtry.go |
@@ -346,8 +346,8 @@ func imageHandler(w http.ResponseWriter, r *http.Request) { |
} |
type Try struct { |
- Hash string |
- CreateTS string |
+ Hash string `json:"hash"` |
+ CreateTS string `json:"create_ts"` |
} |
type Recent struct { |
@@ -418,7 +418,7 @@ func workspaceHandler(w http.ResponseWriter, r *http.Request) { |
name := "" |
if len(match) == 2 { |
name = match[1] |
- rows, err := db.Query("SELECT create_ts, hash FROM workspacetry WHERE name=? ORDER BY create_ts DESC ", name) |
+ rows, err := db.Query("SELECT create_ts, hash FROM workspacetry WHERE name=? ORDER BY create_ts", name) |
if err != nil { |
reportError(w, r, err, "Failed to select.") |
return |
@@ -437,7 +437,7 @@ func workspaceHandler(w http.ResponseWriter, r *http.Request) { |
if len(tries) == 0 { |
code = DEFAULT_SAMPLE |
} else { |
- code = getCode(tries[0].Hash) |
+ code = getCode(tries[len(tries)-1].Hash) |
mtklein
2014/04/21 16:19:01
Undo?
jcgregorio
2014/04/21 16:26:24
This was intentional, the history list is construc
mtklein
2014/04/21 16:31:14
Ah! Missed the DESC change. Thanks.
|
} |
if err := workspaceTemplate.Execute(w, Workspace{Tries: tries, Code: code, Name: name}); err != nil { |
log.Printf("ERROR: Failed to expand template: %q\n", err) |