frontend-data

Implements API calls, pagination, forms, and validation in the OrangeHRM Vue frontend.

Updated Jul 23, 2026
One-click install
npx skills add https://github.com/snow-gift111/orangehrm-ai-sdlc-capstone --skill frontend-data-snow-gift111
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: frontend-data
Source: https://github.com/snow-gift111/orangehrm-ai-sdlc-capstone/tree/main/.agents/skills/frontend-data
Command: npx skills add https://github.com/snow-gift111/orangehrm-ai-sdlc-capstone --skill frontend-data-snow-gift111

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building list pages and forms in the OrangeHRM Vue frontend requires correctly wiring the APIService axios wrapper, reactive data-loading composables, and client/server validation rules — getting any of these wrong causes silent failures like filters not re-fetching, 401s mishandled, or 422 errors invisible to users. ## Core Features & Use Cases - APIService wrapper: Per-resource axios client mirroring backend /api/v2 routes, with automatic 401 page reloads, error toasts, ETag-based caching in production, and setIgnorePath for suppressing expected 422 validation responses. - Data-loading composables: usePaginate for list endpoints with reactive filter/sort re-fetching, useSort for column sorting, and useInfiniteScroll for scroll-based lists. - Form composables and validation: useForm for programmatic submit/reset, useServerValidation for debounced async uniqueness checks against /api/v2/core/validation/unique, and ~40 client-side validation rules covering dates, files, numbers, and formats. - Use Case: Build a new employee list page with filters, sortable columns, and pagination by composing APIService, usePaginate, and useSort, then add a create/edit form with required-field and uniqueness validation using the provided recipes. ## Quick Start Ask the agent to scaffold a new OrangeHRM list page with filters, sorting, and pagination using the frontend-data patterns.

Frequently Asked Questions about frontend-data

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I call an OrangeHRM backend API from a Vue component?

Create an APIService instance with window.appGlobal.baseUrl and the resource path matching the backend route, then call getAll, get, create, update, delete, or deleteAll. Each method returns a Promise of an AxiosResponse with the backend's data, meta, rels envelope.

How do I add pagination and filters to a Vue list page?

Use the usePaginate composable with your APIService and a computed query object built from your filter refs. It watches the query and currentPage, re-fetches automatically on changes, and returns total, pages, response rows, and loading state.

Why does my filter change not re-fetch the list in usePaginate?

The query passed to usePaginate must be a ref or computed, not a plain object, and its serialized value must actually change between updates. Check that v-model bindings match the filter property names and that empty strings are normalized to undefined.

How do I validate unique field values against the server in a form?

Use useServerValidation's createUniqueValidator with the entity name, attribute name, and entityId when editing to ignore the current record. It calls /api/v2/core/validation/unique debounced by 500ms and returns true or a translated error string for the rules array.

Why does a 401 response reload the page instead of rejecting?

The APIService response interceptor calls reloadPage on any 401, which redirects to the login page since the session is gone. You do not handle 401 manually; the interceptor also toasts unexpected errors automatically for other failures.

When should I use setIgnorePath on an APIService?

Call setIgnorePath with a regex matching validation endpoints where 400 or 422 responses are expected signals, such as uniqueness checks, to suppress automatic error toasts. The promise still rejects, so you must catch it yourself if you need to react.