Skip to content

Commit

Permalink
fix: channel update bug (#112)
Browse files Browse the repository at this point in the history
* fix: image config as optional on updating channel

* fix: same channel name between projects
  • Loading branch information
h4l-yup authored Dec 19, 2023
1 parent f8908e0 commit b2dfc1a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ export class ChannelMySQLService {

if (
await this.repository.findOne({
where: { name, id: Not(channelId) },
where: {
name,
id: Not(channelId),
project: { id: channel.project.id },
},
select: ['id'],
})
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@
* under the License.
*/
import { ApiProperty } from '@nestjs/swagger';
import { IsObject, IsString, MaxLength, MinLength } from 'class-validator';
import {
IsObject,
IsOptional,
IsString,
MaxLength,
MinLength,
} from 'class-validator';

import { IsNullable } from '@/domains/user/decorators';
import { ImageConfigRequestDto } from './image-config-request.dto';
Expand All @@ -32,7 +38,8 @@ export class UpdateChannelRequestDto {
@MaxLength(50)
description: string | null;

@ApiProperty({ nullable: true, type: ImageConfigRequestDto })
@ApiProperty({ required: false, nullable: true, type: ImageConfigRequestDto })
@IsOptional()
@IsNullable()
@IsObject()
imageConfig: ImageConfigRequestDto | null;
Expand Down

0 comments on commit b2dfc1a

Please sign in to comment.