From 8278c059ad6ccf70c5100617a7e936c1e1d8be06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Sat, 19 Nov 2022 17:15:46 +0100 Subject: [PATCH] fix context in methods.go --- server/README.md | 3 ++- server/db/methods.go | 7 +++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server/README.md b/server/README.md index b415a58..4058f08 100644 --- a/server/README.md +++ b/server/README.md @@ -9,4 +9,5 @@ - (compat.go) api routes - https://firebase.google.com/docs/cloud-messaging/send-message#rest - List subscribtions on owned channels /RESTful?) - - deploy \ No newline at end of file + - deploy + - Dockerfile \ No newline at end of file diff --git a/server/db/methods.go b/server/db/methods.go index e778aa4..45fb15c 100644 --- a/server/db/methods.go +++ b/server/db/methods.go @@ -1,7 +1,6 @@ package db import ( - "blackforestbytes.com/simplecloudnotifier/logic" "blackforestbytes.com/simplecloudnotifier/models" "database/sql" "gogs.mikescher.com/BlackForestBytes/goext/langext" @@ -533,7 +532,7 @@ func (db *Database) CreateSuccessDelivery(ctx TxContext, client models.Client, m }, nil } -func (db *Database) ListChannels(ctx *logic.AppContext, userid int64) ([]models.Channel, error) { +func (db *Database) ListChannels(ctx TxContext, userid int64) ([]models.Channel, error) { tx, err := ctx.GetOrCreateTransaction(db) if err != nil { return nil, err @@ -571,7 +570,7 @@ func (db *Database) GetChannel(ctx TxContext, userid int64, channelid int64) (mo return client, nil } -func (db *Database) GetSubscription(ctx *logic.AppContext, subid int64) (models.Subscription, error) { +func (db *Database) GetSubscription(ctx TxContext, subid int64) (models.Subscription, error) { tx, err := ctx.GetOrCreateTransaction(db) if err != nil { return models.Subscription{}, err @@ -590,7 +589,7 @@ func (db *Database) GetSubscription(ctx *logic.AppContext, subid int64) (models. return sub, nil } -func (db *Database) DeleteSubscription(ctx *logic.AppContext, subid int64) error { +func (db *Database) DeleteSubscription(ctx TxContext, subid int64) error { tx, err := ctx.GetOrCreateTransaction(db) if err != nil { return err