Refactor web/service hooks to use service wrappers #21406

Closed
opened 2026-02-21 20:12:25 -05:00 by yindo · 0 comments
Owner

Originally created by @lyzno1 on GitHub (Jan 2, 2026).

Goal

Standardize web/service to follow the convention:

  • use-* files expose TanStack Query hooks only.
  • non-use-* files expose pure request wrappers only.

Scope

Refactor existing web/service/use-* hooks to call the service-layer wrappers instead of calling @/service/base directly, and add missing wrappers where needed.

Tasks

  • Ensure each use-* hook delegates to a non-hook service function.
  • Add/extend service modules under web/service/* for missing endpoints.
  • Align types and request signatures (datasets/pipeline/plugins/tools/workflow/common).
  • Keep mocks/tests in sync with the import changes.

Done Criteria

All web/service/use-* hooks depend on web/service/* wrappers, with no direct @/service/base calls in those hooks.

Originally created by @lyzno1 on GitHub (Jan 2, 2026). ### Goal Standardize `web/service` to follow the convention: - `use-*` files expose TanStack Query hooks only. - non-`use-*` files expose pure request wrappers only. ### Scope Refactor existing `web/service/use-*` hooks to call the service-layer wrappers instead of calling `@/service/base` directly, and add missing wrappers where needed. ### Tasks - Ensure each `use-*` hook delegates to a non-hook service function. - Add/extend service modules under `web/service/*` for missing endpoints. - Align types and request signatures (datasets/pipeline/plugins/tools/workflow/common). - Keep mocks/tests in sync with the import changes. ### Done Criteria All `web/service/use-*` hooks depend on `web/service/*` wrappers, with no direct `@/service/base` calls in those hooks.
yindo closed this issue 2026-02-21 20:12:25 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#21406