Adding page to create votes and view the votes, rearanging some methods

This commit is contained in:
2026-01-23 13:54:05 -05:00
parent 0f6e8a8350
commit 3b0a8625bc
10 changed files with 479 additions and 152 deletions

11
server/common/common.go Normal file
View File

@@ -0,0 +1,11 @@
package common
import (
"encoding/json"
"net/http"
)
func SendError(w http.ResponseWriter, errStr string, statusCode int) {
w.WriteHeader(statusCode)
json.NewEncoder(w).Encode(map[string]string{"error": errStr})
}