fix: slice title when longer than max chars during import
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user