(ctx context.Context, id uuid.UUID)
| 2897 | } |
| 2898 | |
| 2899 | func (q *querier) GetChatDebugRunByID(ctx context.Context, id uuid.UUID) (database.ChatDebugRun, error) { |
| 2900 | run, err := q.db.GetChatDebugRunByID(ctx, id) |
| 2901 | if err != nil { |
| 2902 | return database.ChatDebugRun{}, err |
| 2903 | } |
| 2904 | // Authorize via the owning chat. |
| 2905 | chat, err := q.db.GetChatByID(ctx, run.ChatID) |
| 2906 | if err != nil { |
| 2907 | return database.ChatDebugRun{}, err |
| 2908 | } |
| 2909 | if err := q.authorizeContext(ctx, policy.ActionRead, chat); err != nil { |
| 2910 | return database.ChatDebugRun{}, err |
| 2911 | } |
| 2912 | return run, nil |
| 2913 | } |
| 2914 | |
| 2915 | func (q *querier) GetChatDebugRunsByChatID(ctx context.Context, arg database.GetChatDebugRunsByChatIDParams) ([]database.ChatDebugRun, error) { |
| 2916 | chat, err := q.db.GetChatByID(ctx, arg.ChatID) |
nothing calls this directly
no test coverage detected