fix: extend allowed card title length (#301)
* feat: update card title from varchar to text * feat: add input length validation * fix: slice title when longer than max chars during import
This commit is contained in:
@@ -27,7 +27,7 @@ export const cardRouter = createTRPCRouter({
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
title: z.string().min(1),
|
||||
title: z.string().min(1).max(2000),
|
||||
description: z.string().max(10000),
|
||||
listPublicId: z.string().min(12),
|
||||
labelPublicIds: z.array(z.string().min(12)),
|
||||
@@ -760,7 +760,7 @@ export const cardRouter = createTRPCRouter({
|
||||
.input(
|
||||
z.object({
|
||||
cardPublicId: z.string().min(12),
|
||||
title: z.string().min(1).optional(),
|
||||
title: z.string().min(1).max(2000).optional(),
|
||||
description: z.string().optional(),
|
||||
index: z.number().optional(),
|
||||
listPublicId: z.string().min(12).optional(),
|
||||
|
||||
@@ -52,7 +52,7 @@ interface TrelloCheckItem {
|
||||
|
||||
interface TrelloCard {
|
||||
id: string;
|
||||
name: string;
|
||||
name: string | null;
|
||||
desc: string;
|
||||
idList: string;
|
||||
labels: TrelloLabel[];
|
||||
@@ -290,7 +290,7 @@ export const importRouter = createTRPCRouter({
|
||||
if (list.cards.length && newListId) {
|
||||
const cardsInsert = list.cards.map((card, index) => ({
|
||||
publicId: generateUID(),
|
||||
title: card.name,
|
||||
title: (card.name?.trim() ?? "Untitled Card").slice(0, 2000),
|
||||
description: card.description,
|
||||
createdBy: userId,
|
||||
listId: newListId,
|
||||
|
||||
Reference in New Issue
Block a user