bff for callbacks
This commit is contained in:
30
api/pkg/db/internal/mongo/callbacksdb/archived.go
Normal file
30
api/pkg/db/internal/mongo/callbacksdb/archived.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package callbacksdb
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/tech/sendico/pkg/mutil/mzap"
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
func (db *CallbacksDB) SetArchived(
|
||||
ctx context.Context,
|
||||
accountRef,
|
||||
organizationRef,
|
||||
callbackRef bson.ObjectID,
|
||||
isArchived,
|
||||
cascade bool,
|
||||
) error {
|
||||
if err := db.ArchivableDB.SetArchived(ctx, accountRef, callbackRef, isArchived); err != nil {
|
||||
db.DBImp.Logger.Warn("Failed to change callback archive status", zap.Error(err),
|
||||
mzap.AccRef(accountRef),
|
||||
mzap.ObjRef("organization_ref", organizationRef),
|
||||
mzap.ObjRef("callback_ref", callbackRef),
|
||||
zap.Bool("archived", isArchived),
|
||||
zap.Bool("cascade", cascade),
|
||||
)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user