@@ -4,6 +4,7 @@ import { TestSearchParams } from "~/routes/_app.orgs.$organizationSlug.projects.
4
4
import { sortEnvironments } from "~/utils/environmentSort" ;
5
5
import { createSearchParams } from "~/utils/searchParams" ;
6
6
import { findCurrentWorkerDeployment } from "~/v3/models/workerDeployment.server" ;
7
+ import { BasePresenter } from "./basePresenter.server" ;
7
8
8
9
type TaskListOptions = {
9
10
userId : string ;
@@ -15,16 +16,10 @@ export type TaskList = Awaited<ReturnType<TestPresenter["call"]>>;
15
16
export type TaskListItem = NonNullable < TaskList [ "tasks" ] > [ 0 ] ;
16
17
export type SelectedEnvironment = NonNullable < TaskList [ "selectedEnvironment" ] > ;
17
18
18
- export class TestPresenter {
19
- #prismaClient: PrismaClient ;
20
-
21
- constructor ( prismaClient : PrismaClient = prisma ) {
22
- this . #prismaClient = prismaClient ;
23
- }
24
-
19
+ export class TestPresenter extends BasePresenter {
25
20
public async call ( { userId, projectSlug, url } : TaskListOptions ) {
26
21
// Find the project scoped to the organization
27
- const project = await this . #prismaClient . project . findFirstOrThrow ( {
22
+ const project = await this . _replica . project . findFirstOrThrow ( {
28
23
select : {
29
24
id : true ,
30
25
environments : {
@@ -107,7 +102,7 @@ export class TestPresenter {
107
102
108
103
async #getTasks( envId : string , isDev : boolean ) {
109
104
if ( isDev ) {
110
- return await this . #prismaClient . $queryRaw <
105
+ return await this . _replica . $queryRaw <
111
106
{
112
107
id : string ;
113
108
version : string ;
0 commit comments