save oauth user_id and link users and accounts

This commit is contained in:
2025-12-30 02:06:14 -07:00
parent bc592718bf
commit 8090a6f25e
21 changed files with 468 additions and 198 deletions
@@ -1,19 +1,19 @@
{{ componentBody "nav_bar" }}
{{- define "title" }} Inventory++ Account {{ end }}
{{- componentBody "nav_bar" "dot" . }}
{{- $acctID := parseInt64 .PathParams.acctID }}
{{- $acct := (.Accounts.GetAccount $acctID) }}
<h1>Account: {{ .Account.Email }}</h1>
<h1>Account: {{ $acct.Email }} (id: {{ $acctID }})</h1>
{{- $etsyUser := .Etsy.GetUserPointerByAccountID $acctID }}
{{- $etsyUser := .Etsy.GetUserPointerByAccountID .Account.ID }}
{{- if $etsyUser }}
<h3>Etsy User: {{ $etsyUser.UserID }}; Shop ID: {{ $etsyUser.ShopID }}</h3>
{{- else }}
<h3>
<a href="{{ .Etsy.GenerateConnectionURLForNewAccount $acctID }}">
{{/* TODO: create this link dynamically, not EVERYTIME THE PAGE IS LOADED */}}
<a href="{{ .Etsy.GenerateConnectionURLForNewAccount .Account.ID }}">
Link Your Etsy Store!
</a>
</h3>
{{- end }}
<h2><a href="{{$acctID}}/reports">View Reports</a></h2>
<h2><a href="/accounts/{{.Account.ID}}/reports">View Reports</a></h2>