Skip to content

Commit 4e62f4c

Browse files
committed
Added Todo for Matt
1 parent a6d6c52 commit 4e62f4c

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

apps/webapp/app/presenters/v3/LimitsPresenter.server.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,11 @@ export type LimitsResult = {
8484
export class LimitsPresenter extends BasePresenter {
8585
public async call({
8686
organizationId,
87+
projectId,
8788
environmentApiKey,
8889
}: {
8990
organizationId: string;
91+
projectId: string;
9092
environmentApiKey: string;
9193
}): Promise<LimitsResult> {
9294
// Get organization with all limit-related fields
@@ -130,6 +132,7 @@ export class LimitsPresenter extends BasePresenter {
130132
: "default";
131133

132134
// Get schedule count for this org (via project relation which has an index)
135+
//TODO we should change the way we count these and use the ScheduleListPresenter method
133136
const scheduleCount = await this._replica.taskSchedule.count({
134137
where: {
135138
project: {
@@ -141,16 +144,14 @@ export class LimitsPresenter extends BasePresenter {
141144
// Get alert channel count for this org
142145
const alertChannelCount = await this._replica.projectAlertChannel.count({
143146
where: {
144-
project: {
145-
organizationId,
146-
},
147+
projectId,
147148
},
148149
});
149150

150151
// Get active branches count for this org (uses @@index([organizationId]))
151152
const activeBranchCount = await this._replica.runtimeEnvironment.count({
152153
where: {
153-
organizationId,
154+
projectId,
154155
branchName: {
155156
not: null,
156157
},

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.limits/route.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => {
8080
const [error, result] = await tryCatch(
8181
presenter.call({
8282
organizationId: project.organizationId,
83+
projectId: project.id,
8384
environmentApiKey: environment.apiKey,
8485
})
8586
);

0 commit comments

Comments
 (0)