Skip to content

Commit

Permalink
fix: remove useless params
Browse files Browse the repository at this point in the history
  • Loading branch information
darkskygit committed Apr 10, 2024
1 parent 67e2679 commit f081f4c
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions packages/backend/server/src/plugins/copilot/resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,7 @@ export class CopilotResolver {
description: 'Get the quota of the user in the workspace',
complexity: 2,
})
async getQuota(
@Parent() _copilot: CopilotType,
@CurrentUser() user: CurrentUser
) {
async getQuota(@CurrentUser() user: CurrentUser) {
const quota = await this.quota.getUserQuota(user.id);
const limit = quota.feature.copilotActionLimit;

Expand Down Expand Up @@ -231,10 +228,7 @@ export class CopilotResolver {
return new TooManyRequestsException('Server is busy');
}

const { limit, used } = await this.getQuota(
{ workspaceId: undefined },
user
);
const { limit, used } = await this.getQuota(user);
if (limit && Number.isFinite(limit) && used >= limit) {
return new PaymentRequiredException(
`You have reached the limit of actions in this workspace, please upgrade your plan.`
Expand Down

0 comments on commit f081f4c

Please sign in to comment.