2022-04-21 12:37:39 +02:00
|
|
|
package system
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2022-04-27 01:01:45 +02:00
|
|
|
"github.com/zitadel/zitadel/internal/query"
|
|
|
|
system_pb "github.com/zitadel/zitadel/pkg/grpc/system"
|
2022-04-21 12:37:39 +02:00
|
|
|
)
|
|
|
|
|
2022-11-18 13:49:38 +01:00
|
|
|
func (s *Server) ListFailedEvents(ctx context.Context, _ *system_pb.ListFailedEventsRequest) (*system_pb.ListFailedEventsResponse, error) {
|
2022-04-21 12:37:39 +02:00
|
|
|
failedEvents, err := s.query.SearchFailedEvents(ctx, new(query.FailedEventSearchQueries))
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
2023-10-19 12:19:10 +02:00
|
|
|
return &system_pb.ListFailedEventsResponse{Result: FailedEventsToPb(s.database, failedEvents)}, nil
|
2022-04-21 12:37:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Server) RemoveFailedEvent(ctx context.Context, req *system_pb.RemoveFailedEventRequest) (*system_pb.RemoveFailedEventResponse, error) {
|
2023-10-19 12:19:10 +02:00
|
|
|
err := s.query.RemoveFailedEvent(ctx, req.ViewName, req.InstanceId, req.FailedSequence)
|
2022-04-21 12:37:39 +02:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return &system_pb.RemoveFailedEventResponse{}, nil
|
|
|
|
}
|