Index fetches the entities.Discord for an entities.UserID
(ctx context.Context, userID entities.UserID, params repositories.IndexParams)
| 69 | |
| 70 | // Index fetches the entities.Discord for an entities.UserID |
| 71 | func (service *DiscordService) Index(ctx context.Context, userID entities.UserID, params repositories.IndexParams) ([]*entities.Discord, error) { |
| 72 | ctx, span := service.tracer.Start(ctx) |
| 73 | defer span.End() |
| 74 | |
| 75 | ctxLogger := service.tracer.CtxLogger(service.logger, span) |
| 76 | |
| 77 | discordIntegrations, err := service.repository.Index(ctx, userID, params) |
| 78 | if err != nil { |
| 79 | msg := fmt.Sprintf("could not fetch discord integrations with params [%+#v]", params) |
| 80 | return nil, service.tracer.WrapErrorSpan(span, stacktrace.Propagate(err, msg)) |
| 81 | } |
| 82 | |
| 83 | ctxLogger.Info(fmt.Sprintf("fetched [%d] discord integrations with prams [%+#v]", len(discordIntegrations), params)) |
| 84 | return discordIntegrations, nil |
| 85 | } |
| 86 | |
| 87 | // Delete an entities.Discord |
| 88 | func (service *DiscordService) Delete(ctx context.Context, userID entities.UserID, discordID uuid.UUID) error { |
nothing calls this directly
no test coverage detected