fix context in methods.go
This commit is contained in:
parent
7af0ff5413
commit
8278c059ad
@ -10,3 +10,4 @@
|
|||||||
- https://firebase.google.com/docs/cloud-messaging/send-message#rest
|
- https://firebase.google.com/docs/cloud-messaging/send-message#rest
|
||||||
- List subscribtions on owned channels /RESTful?)
|
- List subscribtions on owned channels /RESTful?)
|
||||||
- deploy
|
- deploy
|
||||||
|
- Dockerfile
|
@ -1,7 +1,6 @@
|
|||||||
package db
|
package db
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"blackforestbytes.com/simplecloudnotifier/logic"
|
|
||||||
"blackforestbytes.com/simplecloudnotifier/models"
|
"blackforestbytes.com/simplecloudnotifier/models"
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"gogs.mikescher.com/BlackForestBytes/goext/langext"
|
"gogs.mikescher.com/BlackForestBytes/goext/langext"
|
||||||
@ -533,7 +532,7 @@ func (db *Database) CreateSuccessDelivery(ctx TxContext, client models.Client, m
|
|||||||
}, nil
|
}, 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)
|
tx, err := ctx.GetOrCreateTransaction(db)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -571,7 +570,7 @@ func (db *Database) GetChannel(ctx TxContext, userid int64, channelid int64) (mo
|
|||||||
return client, nil
|
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)
|
tx, err := ctx.GetOrCreateTransaction(db)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return models.Subscription{}, err
|
return models.Subscription{}, err
|
||||||
@ -590,7 +589,7 @@ func (db *Database) GetSubscription(ctx *logic.AppContext, subid int64) (models.
|
|||||||
return sub, nil
|
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)
|
tx, err := ctx.GetOrCreateTransaction(db)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user