mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 16:34:55 +00:00
Rename userUuid to invitedUserUuid in project-user controller and service
This commit is contained in:
@ -35,14 +35,14 @@ export class ProjectUserController {
|
|||||||
description:
|
description:
|
||||||
ControllerRoute.PROJECT.ACTIONS.GET_USERS_BY_PROJECT_DESCRIPTION,
|
ControllerRoute.PROJECT.ACTIONS.GET_USERS_BY_PROJECT_DESCRIPTION,
|
||||||
})
|
})
|
||||||
@Get(':userUuid')
|
@Get(':invitedUserUuid')
|
||||||
async findUserByUuidInProject(
|
async findUserByUuidInProject(
|
||||||
@Param() params: GetProjectParam,
|
@Param() params: GetProjectParam,
|
||||||
@Param('userUuid') userUuid: string,
|
@Param('invitedUserUuid') invitedUserUuid: string,
|
||||||
): Promise<BaseResponseDto> {
|
): Promise<BaseResponseDto> {
|
||||||
return this.projectUserService.getUserByUuidInProject(
|
return this.projectUserService.getUserByUuidInProject(
|
||||||
params.projectUuid,
|
params.projectUuid,
|
||||||
userUuid,
|
invitedUserUuid,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -67,13 +67,13 @@ export class ProjectUserService {
|
|||||||
}
|
}
|
||||||
async getUserByUuidInProject(
|
async getUserByUuidInProject(
|
||||||
projectUuid: string,
|
projectUuid: string,
|
||||||
userUuid: string,
|
invitedUserUuid: string,
|
||||||
): Promise<BaseResponseDto> {
|
): Promise<BaseResponseDto> {
|
||||||
try {
|
try {
|
||||||
const user = await this.inviteUserRepository.findOne({
|
const user = await this.inviteUserRepository.findOne({
|
||||||
where: {
|
where: {
|
||||||
project: { uuid: projectUuid },
|
project: { uuid: projectUuid },
|
||||||
uuid: userUuid,
|
uuid: invitedUserUuid,
|
||||||
isActive: true,
|
isActive: true,
|
||||||
},
|
},
|
||||||
select: [
|
select: [
|
||||||
@ -92,7 +92,7 @@ export class ProjectUserService {
|
|||||||
|
|
||||||
if (!user) {
|
if (!user) {
|
||||||
throw new HttpException(
|
throw new HttpException(
|
||||||
`User with ID ${userUuid} not found in project ${projectUuid}`,
|
`User with ID ${invitedUserUuid} not found in project ${projectUuid}`,
|
||||||
HttpStatus.NOT_FOUND,
|
HttpStatus.NOT_FOUND,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user