aboutsummaryrefslogtreecommitdiff
path: root/plugins/carddav/routes.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/carddav/routes.go')
-rw-r--r--plugins/carddav/routes.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/plugins/carddav/routes.go b/plugins/carddav/routes.go
index 82b729e..2f33852 100644
--- a/plugins/carddav/routes.go
+++ b/plugins/carddav/routes.go
@@ -3,7 +3,6 @@ package koushincarddav
import (
"fmt"
"net/http"
- "net/url"
"git.sr.ht/~emersion/koushin"
"github.com/emersion/go-vcard"
@@ -22,11 +21,11 @@ type AddressObjectRenderData struct {
AddressObject *carddav.AddressObject
}
-func registerRoutes(p *koushin.GoPlugin, u *url.URL) {
+func registerRoutes(p *plugin) {
p.GET("/contacts", func(ctx *koushin.Context) error {
queryText := ctx.QueryParam("query")
- c, addressBook, err := getAddressBook(u, ctx.Session)
+ c, addressBook, err := p.clientWithAddressBook(ctx.Session)
if err != nil {
return err
}
@@ -70,7 +69,7 @@ func registerRoutes(p *koushin.GoPlugin, u *url.URL) {
p.GET("/contacts/:uid", func(ctx *koushin.Context) error {
uid := ctx.Param("uid")
- c, addressBook, err := getAddressBook(u, ctx.Session)
+ c, addressBook, err := p.clientWithAddressBook(ctx.Session)
if err != nil {
return err
}