11import { HttpStatus , Inject , Injectable } from '@nestjs/common' ;
22import { IProjectsRepository } from '../repository' ;
33import type { CreateProjectDto , CreateShareTokenDto , UpdateProjectDto } from '../dtos' ;
4- import { FindTeamCommand , FindTeamMemberCommand } from '@core/modules/teams' ;
54import { ROLE_PRIORITY } from '@shared/constants' ;
65import { ProjectStatus } from '../entities' ;
76import { ProjectsMapper } from '../mappers' ;
87import { createHash , randomBytes } from 'crypto' ;
98import { BaseException } from '@shared/error' ;
9+ import { FindTeamMemberQuery , FindTeamQuery } from '@core/teams' ;
1010
1111@Injectable ( )
1212export class ProjectsService {
1313 constructor (
1414 @Inject ( 'IProjectsRepository' )
1515 private readonly projectsRepo : IProjectsRepository ,
16- private readonly findTeamCommand : FindTeamCommand ,
17- private readonly findTeamMemberCommand : FindTeamMemberCommand ,
16+ private readonly findTeamQ : FindTeamQuery ,
17+ private readonly findTeamMemberQ : FindTeamMemberQuery ,
1818 ) { }
1919
2020 public create = async ( userId : string , slug : string , dto : CreateProjectDto ) => {
@@ -254,7 +254,7 @@ export class ProjectsService {
254254 userId : string ,
255255 minRole : keyof typeof ROLE_PRIORITY = 'viewer' ,
256256 ) {
257- const team = await this . findTeamCommand . execute ( slug ) ;
257+ const team = await this . findTeamQ . execute ( slug ) ;
258258 if ( ! team ) {
259259 throw new BaseException (
260260 {
@@ -265,7 +265,7 @@ export class ProjectsService {
265265 ) ;
266266 }
267267
268- const member = await this . findTeamMemberCommand . execute ( team . id , userId ) ;
268+ const member = await this . findTeamMemberQ . execute ( team . id , userId ) ;
269269 if ( ! member ) {
270270 throw new BaseException (
271271 {
0 commit comments