Switch icon service to new endpoint and adapt response schema#234
Conversation
Agent-Logs-Url: https://github.com/antvis/Infographic/sessions/ae8e7065-2a47-4713-ae97-183a3a6131ef Co-authored-by: hustcc <7856674+hustcc@users.noreply.github.com>
Agent-Logs-Url: https://github.com/antvis/Infographic/sessions/748fee0b-c8fb-4f18-abdd-d46e041629d3 Co-authored-by: hustcc <7856674+hustcc@users.noreply.github.com>
|
@Aarebecca 服务迁移,正好改了一下架构,去掉了冗余的 data.data 接口返回结构。 |
|
@copilot ci 报错,帮我看看,是不是有哪些地方没有修改全。 https://github.com/antvis/Infographic/actions/runs/24434747851/job/71387207750?pr=234 |
Agent-Logs-Url: https://github.com/antvis/Infographic/sessions/0e61a01a-b243-4a83-abe0-4bdcc7d3506b Co-authored-by: hustcc <7856674+hustcc@users.noreply.github.com>
The SSR test mock in |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #234 +/- ##
=======================================
Coverage 46.85% 46.85%
=======================================
Files 342 342
Lines 28416 28416
Branches 2400 2400
=======================================
Hits 13315 13315
Misses 15088 15088
Partials 13 13
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Migrates the icon search service from
https://www.weavefox.cn/api/open/v1/icontohttps://lab.weavefox.cn/api/v1/infographic/icon. The new endpoint returns a flatter response structure —datais now a top-level array and the outer success flag issuccess(boolean) instead ofstatus.Changes
src/constants/service.ts— updateICON_SERVICE_URLsrc/resource/loaders/search.ts— fix response parsing:result?.status→result?.success,result.data.data[0]→result.data[0]site/src/components/IconPage/index.tsx— update all three URL references (fetch call,endpointUrlmemo, JSX display), fix parsing (result.data.data→result.data, guard onresult.success), and update the displayed response exampleResponse schema before → after: