admin.service.ts 997 B

123456789101112131415161718192021222324252627282930
  1. import { Injectable, NotFoundException, ForbiddenException } from '@nestjs/common';
  2. import { UserService } from '../user/user.service';
  3. import { TenantService } from '../tenant/tenant.service';
  4. @Injectable()
  5. export class AdminService {
  6. constructor(
  7. private readonly userService: UserService,
  8. private readonly tenantService: TenantService,
  9. ) { }
  10. async getTenantUsers(tenantId: string) {
  11. return this.userService.findByTenantId(tenantId);
  12. }
  13. async getTenantSettings(tenantId: string) {
  14. return this.tenantService.getSettings(tenantId);
  15. }
  16. async updateTenantSettings(tenantId: string, data: any) {
  17. return this.tenantService.updateSettings(tenantId, data);
  18. }
  19. // Notebook sharing approval and model assignments would go here
  20. async getPendingShares(tenantId: string) {
  21. // Mock implementation for pending shares to satisfy UI.
  22. // Needs proper schema/entity support in the future.
  23. return [];
  24. }
  25. }