Detach integration from workflow
(ctx context.Context, orgID, attachmentID string)
| 373 | |
| 374 | // Detach integration from workflow |
| 375 | func (uc *IntegrationUseCase) Detach(ctx context.Context, orgID, attachmentID string) error { |
| 376 | ctx, span := otelx.Start(ctx, integrationTracer, "IntegrationUseCase.Detach") |
| 377 | defer span.End() |
| 378 | |
| 379 | orgUUID, err := uuid.Parse(orgID) |
| 380 | if err != nil { |
| 381 | return NewErrInvalidUUID(err) |
| 382 | } |
| 383 | |
| 384 | attachmentUUID, err := uuid.Parse(attachmentID) |
| 385 | if err != nil { |
| 386 | return NewErrInvalidUUID(err) |
| 387 | } |
| 388 | |
| 389 | // Make sure that the attachment is part of the provided organization |
| 390 | if attachment, err := uc.integrationARepo.FindByIDInOrg(ctx, orgUUID, attachmentUUID); err != nil { |
| 391 | return err |
| 392 | } else if attachment == nil { |
| 393 | return NewErrNotFound("attachment") |
| 394 | } |
| 395 | |
| 396 | return uc.integrationARepo.SoftDelete(ctx, attachmentUUID) |
| 397 | } |
| 398 | |
| 399 | func (uc *IntegrationUseCase) GetAttachment(ctx context.Context, orgID, attID uuid.UUID) (*IntegrationAttachment, error) { |
| 400 | ctx, span := otelx.Start(ctx, integrationTracer, "IntegrationUseCase.GetAttachment") |
nothing calls this directly
no test coverage detected