Compare commits

...

1 Commits

Author SHA1 Message Date
2b00dd0aac add check if not space not found 2025-06-24 11:04:10 +03:00

View File

@ -333,7 +333,12 @@ export class SpaceService {
.andWhere('space.disabled = :disabled', { disabled: false });
const space = await queryBuilder.getOne();
if (!space) {
throw new HttpException(
`Space with ID ${spaceUuid} not found`,
HttpStatus.NOT_FOUND,
);
}
return new SuccessResponseDto({
message: `Space with ID ${spaceUuid} successfully fetched`,
data: space,
@ -343,7 +348,7 @@ export class SpaceService {
throw error; // If it's an HttpException, rethrow it
} else {
throw new HttpException(
'An error occurred while deleting the community',
'An error occurred while fetching the space',
HttpStatus.INTERNAL_SERVER_ERROR,
);
}