fix: refs for dynamo db
This commit is contained in:
parent
c2defdbaac
commit
3fefcfcd9a
|
@ -93,7 +93,7 @@ func (p *provider) ListVerificationRequests(ctx context.Context, pagination *mod
|
|||
// DeleteVerificationRequest to delete verification request from database
|
||||
func (p *provider) DeleteVerificationRequest(ctx context.Context, verificationRequest *models.VerificationRequest) error {
|
||||
collection := p.db.Table(models.Collections.VerificationRequest)
|
||||
if verificationRequest.ID != "" {
|
||||
if verificationRequest != nil {
|
||||
err := collection.Delete("id", verificationRequest.ID).RunWithContext(ctx)
|
||||
|
||||
if err != nil {
|
||||
|
|
|
@ -114,14 +114,14 @@ func (p *provider) GetWebhookByEventName(ctx context.Context, eventName string)
|
|||
// DeleteWebhook to delete webhook
|
||||
func (p *provider) DeleteWebhook(ctx context.Context, webhook *model.Webhook) error {
|
||||
// Also delete webhook logs for given webhook id
|
||||
if webhook.ID != "" {
|
||||
if webhook != nil {
|
||||
webhookCollection := p.db.Table(models.Collections.Webhook)
|
||||
var pagination *model.Pagination
|
||||
webhookLogCollection := p.db.Table(models.Collections.WebhookLog)
|
||||
err := webhookCollection.Delete("id", webhook.ID).RunWithContext(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
pagination := &model.Pagination{}
|
||||
webhookLogs, errIs := p.ListWebhookLogs(ctx, pagination, webhook.ID)
|
||||
for _, webhookLog := range webhookLogs.WebhookLogs {
|
||||
err = webhookLogCollection.Delete("id", webhookLog.ID).RunWithContext(ctx)
|
||||
|
|
Loading…
Reference in New Issue
Block a user