Skip to content

Commit

Permalink
🐞 fix:修復频道命名冲突问题
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackishGreen33 committed Jul 11, 2024
1 parent bce4ccf commit 07837d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/api/channels/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export async function POST(req: Request) {
return new NextResponse('Server ID missing', { status: 400 });
}

if (name === '一般') {
if (name === '一般频道') {
return new NextResponse("Name cannot be '一般频道'", { status: 400 });
}

Expand Down
4 changes: 2 additions & 2 deletions src/common/components/modals/create-channel-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ const formSchema = z.object({
.min(1, {
message: '频道名称为必填。',
})
.refine((name) => name !== '一般', {
message: '频道名称不能为“一般”',
.refine((name) => name !== '一般频道', {
message: '频道名称不能为“一般频道”',
}),
type: z.nativeEnum(ChannelType),
});
Expand Down

0 comments on commit 07837d1

Please sign in to comment.