diff --git a/appview/db/pulls.go b/appview/db/pulls.go
index 10f7e47a..d426a7fd 100644
--- a/appview/db/pulls.go
+++ b/appview/db/pulls.go
@@ -295,11 +295,14 @@ type PullCount struct {
func GetPullCount(e Execer, repoAt syntax.ATURI) (PullCount, error) {
row := e.QueryRow(`
select
- count(case when state = 0 then 1 end) as open_count,
- count(case when state = 1 then 1 end) as merged_count,
- count(case when state = 2 then 1 end) as closed_count
+ count(case when state = ? then 1 end) as open_count,
+ count(case when state = ? then 1 end) as merged_count,
+ count(case when state = ? then 1 end) as closed_count
from pulls
where repo_at = ?`,
+ PullOpen,
+ PullMerged,
+ PullClosed,
repoAt,
)
diff --git a/appview/pages/templates/repo/pulls/pull.html b/appview/pages/templates/repo/pulls/pull.html
index 5ceaae99..bedc734b 100644
--- a/appview/pages/templates/repo/pulls/pull.html
+++ b/appview/pages/templates/repo/pulls/pull.html
@@ -35,9 +35,9 @@
>
{{ .Pull.State.String }}
-
+
opened by
- {{ $owner := didOrHandle .Pull.OwnerDid .PullOwnerHandle }}
+ {{ $owner := index $.DidHandleMap .Pull.OwnerDid }}
{{ $owner }}
@@ -80,9 +80,7 @@
id="patch"
name="patch"
class="font-mono w-full h-full p-4 rounded-b border border-gray-200 text-sm hidden"
- >
-{{- .Pull.Patch -}}
+ >{{- .Pull.Patch -}}