fix: slice title when longer than max chars during import

This commit is contained in:
Henry
2025-12-29 22:19:28 +00:00
parent 019411de3f
commit 845e7e81c1

View File

@@ -52,7 +52,7 @@ interface TrelloCheckItem {
interface TrelloCard { interface TrelloCard {
id: string; id: string;
name: string; name: string | null;
desc: string; desc: string;
idList: string; idList: string;
labels: TrelloLabel[]; labels: TrelloLabel[];
@@ -290,7 +290,7 @@ export const importRouter = createTRPCRouter({
if (list.cards.length && newListId) { if (list.cards.length && newListId) {
const cardsInsert = list.cards.map((card, index) => ({ const cardsInsert = list.cards.map((card, index) => ({
publicId: generateUID(), publicId: generateUID(),
title: card.name, title: (card.name?.trim() ?? "Untitled Card").slice(0, 2000),
description: card.description, description: card.description,
createdBy: userId, createdBy: userId,
listId: newListId, listId: newListId,