Skip to content

feat: handle API cache for list insights project API#3075

Merged
Sameh16 merged 5 commits into
mainfrom
CM-2269
May 19, 2025
Merged

feat: handle API cache for list insights project API#3075
Sameh16 merged 5 commits into
mainfrom
CM-2269

Conversation

@Sameh16
Copy link
Copy Markdown
Collaborator

@Sameh16 Sameh16 commented May 16, 2025

Changes proposed ✍️

What

copilot:summary

copilot:poem

Why

How

copilot:walkthrough

Checklist ✅

  • Label appropriately with Feature, Improvement, or Bug.
  • Add screenshots to the PR description for relevant FE changes
  • New backend functionality has been unit-tested.
  • API documentation has been updated (if necessary) (see docs on API documentation).
  • Quality standards are met.

Sameh16 added 4 commits May 16, 2025 15:39
Signed-off-by: Sameh16 <sameh_mohamed16@hotmail.com>
…ation

Signed-off-by: Sameh16 <sameh_mohamed16@hotmail.com>
…nsights project components

Signed-off-by: Sameh16 <sameh_mohamed16@hotmail.com>
@Sameh16 Sameh16 self-assigned this May 16, 2025
@Sameh16 Sameh16 requested a review from gaspergrom as a code owner May 16, 2025 14:29
@Sameh16 Sameh16 requested a review from Copilot May 16, 2025 14:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the Insights Projects admin UI to use TanStack Vue Query for data fetching and caching, replacing manual load more and loading states with useInfiniteQuery/useMutation.

  • Refactored service methods to return typed promises and support query functions.
  • Migrated page and add-project component to use Vue Query hooks for listing, creating, updating, and deleting.
  • Introduced InsightsProjectRequest interface and updated helper for strong typing.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
frontend/src/modules/admin/modules/insights-projects/services/insights-projects.service.ts Refactored HTTP methods into typed instance methods for Vue Query usage.
frontend/src/modules/admin/modules/insights-projects/pages/insights-projects.page.vue Replaced manual fetch/loading with useInfiniteQuery, updated bindings.
frontend/src/modules/admin/modules/insights-projects/models/insights-project.model.ts Added InsightsProjectRequest to define request payload shape.
frontend/src/modules/admin/modules/insights-projects/insight-project-helper.ts Added explicit return type to buildRequest.
frontend/src/modules/admin/modules/insights-projects/components/lf-insights-project-add.vue Replaced manual service calls with useQuery and useMutation.
frontend/src/modules/admin/modules/collections/pages/collection.page.vue Fixed total rows fallback to use `total
Comments suppressed due to low confidence (2)

frontend/src/modules/admin/modules/insights-projects/pages/insights-projects.page.vue:12

  • The search input was unbound after removing @update:model-value. Add v-model:model-value="search" (or the equivalent prop/event bindings) so the search ref updates and debounced queries run.
@update:model-value="searchProjects()"

frontend/src/modules/admin/modules/insights-projects/services/insights-projects.service.ts:42

  • [nitpick] The delete method name shadows the built-in delete operator and may confuse readers; consider renaming it to deleteProject or remove for clarity.
delete(id: string) {

@Sameh16 Sameh16 merged commit fa9a8ae into main May 19, 2025
6 checks passed
@Sameh16 Sameh16 deleted the CM-2269 branch May 19, 2025 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants