diff --git a/packages/trpc/src/routers/private/grid-bot/create-bot/handler.ts b/packages/trpc/src/routers/private/grid-bot/create-bot/handler.ts index 833529c7..71ce106e 100644 --- a/packages/trpc/src/routers/private/grid-bot/create-bot/handler.ts +++ b/packages/trpc/src/routers/private/grid-bot/create-bot/handler.ts @@ -38,6 +38,13 @@ export async function createGridBot({ ctx, input }: Options) { }); } + if (data.settings.gridLines.length === 0) { + throw new TRPCError({ + message: "The bot has no configured grid lines. Please set at least one grid line", + code: "PARSE_ERROR", + }); + } + const bot = await xprisma.bot.grid.create({ data: { ...data,