diff --git a/public/locale/en.json b/public/locale/en.json index 04e259b9d6a..1b7f63d13cb 100644 --- a/public/locale/en.json +++ b/public/locale/en.json @@ -640,6 +640,7 @@ "create_consultation": "Create Consultation", "create_encounter": "Create Encounter", "create_facility": "Create Facility", + "create_new": "Create New", "create_new_asset": "Create New Asset", "create_new_encounter": "Create a new encounter to get started", "create_new_facility": "Create a new facility and add it to the organization.", @@ -1269,6 +1270,7 @@ "make_facility_public": "Make this facility public", "make_facility_public_description": "When enabled, this facility will be visible to the public and can be discovered by anyone using the platform", "make_multiple_beds_label": "Do you want to make multiple beds?", + "manage_and_view_questionnaires": "Manage and view questionnaires", "manage_bed_presets": "Manage Presets of Bed", "manage_facility_users": "Manage encounters", "manage_my_schedule": "Manage my schedule", @@ -1722,6 +1724,7 @@ "questionnaire_not_exist": "The questionnaire you tried to access does not exist.", "questionnaire_submission_failed": "Failed to submit questionnaire", "questionnaire_submitted_successfully": "Questionnaire submitted successfully", + "questionnaires": "Questionnaires", "quick_access": "Quick Access", "quick_actions": "Quick Actions", "quick_actions_description": "Schedule an appointment or create a new encounter", @@ -2036,6 +2039,7 @@ "skills": "Skills", "slot_configuration": "Slot Configuration", "slots_left": "slots left", + "slug": "Slug", "social_profile": "Social Profile", "social_profile_detail": "Include occupation, ration card category, socioeconomic status, and domestic healthcare support for a complete profile.", "socioeconomic_status": "Socioeconomic status", diff --git a/src/components/Questionnaire/index.tsx b/src/components/Questionnaire/index.tsx index 54353743df9..e7e63f65e3b 100644 --- a/src/components/Questionnaire/index.tsx +++ b/src/components/Questionnaire/index.tsx @@ -1,4 +1,5 @@ import { useQuery } from "@tanstack/react-query"; +import { t } from "i18next"; import { useNavigate } from "raviger"; import { Badge } from "@/components/ui/badge"; @@ -6,15 +7,25 @@ import { Button } from "@/components/ui/button"; import Loading from "@/components/Common/Loading"; +import useFilters from "@/hooks/useFilters"; + import query from "@/Utils/request/query"; import { QuestionnaireDetail } from "@/types/questionnaire/questionnaire"; import questionnaireApi from "@/types/questionnaire/questionnaireApi"; export function QuestionnaireList() { + const { qParams, Pagination, resultsPerPage } = useFilters({ + limit: 15, + }); const navigate = useNavigate(); const { data: response, isLoading } = useQuery({ - queryKey: ["questionnaires"], - queryFn: query(questionnaireApi.list), + queryKey: ["questionnaires", qParams], + queryFn: query(questionnaireApi.list, { + queryParams: { + limit: resultsPerPage, + offset: ((qParams.page ?? 1) - 1) * resultsPerPage, + }, + }), }); if (isLoading) { @@ -27,11 +38,11 @@ export function QuestionnaireList() {
Manage and view questionnaires
+{t("manage_and_view_questionnaires")}