Skip to content

Commit 3fefcfc

Browse files
committed
fix: refs for dynamo db
1 parent c2defdb commit 3fefcfc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

server/db/providers/dynamodb/verification_requests.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func (p *provider) ListVerificationRequests(ctx context.Context, pagination *mod
9393
// DeleteVerificationRequest to delete verification request from database
9494
func (p *provider) DeleteVerificationRequest(ctx context.Context, verificationRequest *models.VerificationRequest) error {
9595
collection := p.db.Table(models.Collections.VerificationRequest)
96-
if verificationRequest.ID != "" {
96+
if verificationRequest != nil {
9797
err := collection.Delete("id", verificationRequest.ID).RunWithContext(ctx)
9898

9999
if err != nil {

server/db/providers/dynamodb/webhook.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,14 @@ func (p *provider) GetWebhookByEventName(ctx context.Context, eventName string)
114114
// DeleteWebhook to delete webhook
115115
func (p *provider) DeleteWebhook(ctx context.Context, webhook *model.Webhook) error {
116116
// Also delete webhook logs for given webhook id
117-
if webhook.ID != "" {
117+
if webhook != nil {
118118
webhookCollection := p.db.Table(models.Collections.Webhook)
119-
var pagination *model.Pagination
120119
webhookLogCollection := p.db.Table(models.Collections.WebhookLog)
121120
err := webhookCollection.Delete("id", webhook.ID).RunWithContext(ctx)
122121
if err != nil {
123122
return err
124123
}
124+
pagination := &model.Pagination{}
125125
webhookLogs, errIs := p.ListWebhookLogs(ctx, pagination, webhook.ID)
126126
for _, webhookLog := range webhookLogs.WebhookLogs {
127127
err = webhookLogCollection.Delete("id", webhookLog.ID).RunWithContext(ctx)

0 commit comments

Comments
 (0)