Daily Tech Briefing
AI 科技速览
每天 5 分钟内学习 AI。获取最新的人工智能新闻,理解其重要性,并学习如何将其应用于您的工作。
Dev.to AI · 2026/8/4 16:50:44
Cleaning Dead Routes, Fixing Development Sheets, and Connecting Incidents in a NestJS‑ClickUp‑Notion CRM
AI 中文解读
开发团队给CRM系统做了一次"大扫除",清掉了几个影响使用的"程序地雷"。这次更新最亮眼的地方在于,把不同软件之间的数据通道彻底打通了:以前CRM系统里有些页面是空壳子,点进去要么报错要么显示假信息,现在这些"僵尸页面"被删除,修复了程序调用错误,还新增了自动创建开发表单的功能,最关键的是让事件记录能直接从ClickUp同步数据。用大白话说,就像整理办公室——扔掉没用的旧文件、修好打不开的抽屉、把公司的记事本和工作系统连起来,所有信息终于对上了。对普通人来说,这些改动虽然看不见摸不着,但意味着公司内部系统运行更稳定,员工操作时不卡顿、不报错,客户信息流转也更准确。比如你在用这类系统时,不会再遇到"点击没反应"或"页面显示错误"的情况,后台人员处理问题的效率提高,最终你的服务体验也会更顺畅。
<h1>
Cleaning Dead Routes, Fixing Development Sheets, and Connecting Incidents in a NestJS‑ClickUp‑Notion CRM
</h1>
<p><strong>TL;DR:</strong><br><br>
I removed unused routes from <code>DevelopmentsController</code>, fixed the wrong controller reference in <code>VentasController</code>, added the missing <code>create</code> flow for development sheets in Craft, and wired up the incident API to pull data from ClickUp. These changes eliminate runtime errors, streamline the API surface, and sync incident data with development tickets.</p>
<h2>
The Problem
</h2>
<p>The CRM API was leaking several bugs that surfaced during integration tests and in production:</p>
<ol>
<li>
<strong>Dead routes</strong> – <code>DevelopmentsController</code> still exported endpoints that never existed in the database schema, leading to 404s and unnecessary validation overhead.</li>
<li>
<strong>Wrong controller reference</strong> – The <code>VentasController</code> tried to call a method on the <code>DevelopmentsController</code> that had been renamed, causing a <code>TypeError: undefined is not a function</code>.</li>
<li>
<strong>Missing development sheet creation</strong> – When a new development record was inserted, the corresponding Craft sheet was never created, breaking downstream analytics.</li>
<li>
<strong>Fake incident cards</strong> – The front‑end rendered seven placeholder incident cards that never mapped to real data, confusing users and bloating the UI.</li>
<li>
<strong>Docs out of sync</strong> – The <code>CLAUDE.md</code> and <code>CLAUDE_CODE_CONTEXT.md</code> files referenced an old commit hash (<code>08ed379</code>) instead of the current one (<code>bad3d3b</code>).</li>
</ol>
<p>These issues were surfacing as runtime errors and confusing UI states, so I needed a clean, reproducible fix.</p>
<h2>
What I Tried First
</h2>
<p>I started by inspecting the stack traces from the failing tests. The first error was a 404 from the development endpoints, so I ran a quick grep:<br>
</p>
<div class="highlight js-code-highlight">
<pre class="highlight shell"><code><span class="nb">grep</span> <span class="nt">-R</span> <span class="s2">"DevelopmentsController"</span> <span class="nt">-n</span> apps/api/src/ventas
</code></pre>
</div>
<p>This revealed that the controller had a <code>@Get('dead-route')</code> that never matched any database field. I initially thought to just comment it out, but that would leave an orphaned route in the Swagger docs. I then tried to delete the route manually, but the compiler complained about missing imports.</p>
<p>Next, I looked at the <code>VentasController</code> error. The stack trace pointed to a call to <code>this.developmentsService.create()</code> that no longer existed. I patched the service with a dummy method to bypass the error, but that didn’t solve the underlying mismatch.</p>
<p>For the missing sheet creation, I added a temporary console log after the database insert to confirm that the request reached the controller. It did, but the subsequent call to <code>CraftService.createSheet()</code> was never made because the function was never invoked.</p>
<p>Finally, I checked the front‑end. The <code>page.tsx</code> had a hard‑coded array of seven cards. I removed them manually, but the UI still showed placeholders because the state was still pulling from an old endpoint that returned an empty array.</p>
<h2>
The Implementation
</h2>
<p>Below is a walk‑through of the concrete changes I made, including the exact file diffs and architecture decisions.</p>
<h3>
1. Cleaned Dead Routes in <code>DevelopmentsController</code>
</h3>
<div class="highlight js-code-highlight">
<pre class="highlight diff"><code><span class="gd">- import { Body, Controller, Delete, Get, Param, Patch, Post, Query, UseGuards } from "@nestjs/common";
</span><span class="gi">+ import { Body, Controller, Delete, Get, Param, Patch, UseGuards } from "@nestjs/common";
</span></
分享
阅读原文 ↗