fix: missing quota resolver (#7094)

This commit is contained in:
darkskygit
2024-05-28 12:05:49 +00:00
parent e417c4cd44
commit 1a269a4b52
3 changed files with 26 additions and 2 deletions
@@ -3,6 +3,7 @@ import { Module } from '@nestjs/common';
import { FeatureModule } from '../features';
import { StorageModule } from '../storage';
import { PermissionService } from '../workspaces/permission';
import { QuotaManagementResolver } from './resolver';
import { QuotaService } from './service';
import { QuotaManagementService } from './storage';
@@ -14,7 +15,12 @@ import { QuotaManagementService } from './storage';
*/
@Module({
imports: [FeatureModule, StorageModule],
providers: [PermissionService, QuotaService, QuotaManagementService],
providers: [
PermissionService,
QuotaService,
QuotaManagementResolver,
QuotaManagementService,
],
exports: [QuotaService, QuotaManagementService],
})
export class QuotaModule {}
@@ -56,7 +56,7 @@ class UserQuotaType {
}
@Resolver(() => UserType)
export class FeatureManagementResolver {
export class QuotaManagementResolver {
constructor(private readonly quota: QuotaService) {}
@ResolveField(() => UserQuotaType, { name: 'quota', nullable: true })
+18
View File
@@ -470,6 +470,23 @@ type UserInvoice {
union UserOrLimitedUser = LimitedUserType | UserType
type UserQuota {
blobLimit: SafeInt!
historyPeriod: SafeInt!
humanReadable: UserQuotaHumanReadable!
memberLimit: Int!
name: String!
storageQuota: SafeInt!
}
type UserQuotaHumanReadable {
blobLimit: String!
historyPeriod: String!
memberLimit: String!
name: String!
storageQuota: String!
}
type UserSubscription {
canceledAt: DateTime
createdAt: DateTime!
@@ -517,6 +534,7 @@ type UserType {
"""User name"""
name: String!
quota: UserQuota
subscription(plan: SubscriptionPlan = Pro): UserSubscription @deprecated(reason: "use `UserType.subscriptions`")
subscriptions: [UserSubscription!]!
token: tokenType! @deprecated(reason: "use [/api/auth/authorize]")