prototype report page

This commit is contained in:
2025-12-28 14:38:06 -07:00
parent 49bbe281df
commit 051cf1da5d
13 changed files with 330 additions and 17 deletions
+9 -1
View File
@@ -21,9 +21,17 @@ func NewWebhookHandler(db *raw_events.Store) http.Handler {
ts := time.Now().UTC()
storeID := "test-store-id"
var payloadObject struct {
StoreID string
}
if err := json.Unmarshal(body, &payloadObject); err == nil && payloadObject.StoreID != "" {
storeID = payloadObject.StoreID
}
err := db.Save(r.Context(), &raw_events.Event{
Platform: "etsy",
StoreID: "test-store-1",
StoreID: storeID,
EventID: fmt.Sprint(ts.Unix()),
EventTimestamp: ts,
Payload: body,