From 6fd1663d8c27fbfd5adc93a3aa973f78a2eeb719 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sat, 22 Feb 2025 13:35:17 +0100 Subject: chore(tfstated): change database state id and version id formats to uuidv7 --- pkg/webui/state.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'pkg/webui/state.go') diff --git a/pkg/webui/state.go b/pkg/webui/state.go index 2ad1597..c12ee03 100644 --- a/pkg/webui/state.go +++ b/pkg/webui/state.go @@ -3,10 +3,10 @@ package webui import ( "html/template" "net/http" - "strconv" "git.adyxax.org/adyxax/tfstated/pkg/database" "git.adyxax.org/adyxax/tfstated/pkg/model" + "go.n16f.net/uuid" ) var stateTemplate = template.Must(template.ParseFS(htmlFS, "html/base.html", "html/state.html")) @@ -19,9 +19,8 @@ func handleStateGET(db *database.DB) http.Handler { Versions []model.Version } return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - stateIdStr := r.PathValue("id") - stateId, err := strconv.Atoi(stateIdStr) - if err != nil { + var stateId uuid.UUID + if err := stateId.Parse(r.PathValue("id")); err != nil { errorResponse(w, http.StatusBadRequest, err) return } -- cgit v1.2.3