|
4 | 4 |
|
5 | 5 | from rest_framework.response import Response |
6 | 6 |
|
| 7 | +from sentry import eventstore |
7 | 8 | from sentry.api.base import DocSection |
8 | 9 | from sentry.api.bases import GroupEndpoint |
9 | 10 | from sentry.api.paginator import GenericOffsetPaginator |
10 | 11 | from sentry.api.serializers import EventSerializer, serialize |
11 | | -from sentry.models import Group, GroupHash, SnubaEvent |
| 12 | +from sentry.models import Group, GroupHash |
12 | 13 | from sentry.tasks.unmerge import unmerge |
13 | 14 | from sentry.utils.apidocs import scenario, attach_scenarios |
14 | 15 | from sentry.utils.snuba import raw_query |
@@ -79,14 +80,9 @@ def __handle_results(self, project_id, group_id, user, results): |
79 | 80 | return [self.__handle_result(user, project_id, group_id, result) for result in results] |
80 | 81 |
|
81 | 82 | def __handle_result(self, user, project_id, group_id, result): |
82 | | - event = { |
83 | | - "timestamp": result["latest_event_timestamp"], |
84 | | - "event_id": result["event_id"], |
85 | | - "group_id": group_id, |
86 | | - "project_id": project_id, |
87 | | - } |
| 83 | + event = eventstore.get_event_by_id(project_id, result["event_id"]) |
88 | 84 |
|
89 | 85 | return { |
90 | 86 | "id": result["primary_hash"], |
91 | | - "latestEvent": serialize(SnubaEvent(event), user, EventSerializer()), |
| 87 | + "latestEvent": serialize(event, user, EventSerializer()), |
92 | 88 | } |
0 commit comments