From db2d2195e99c8f580d8f31cc2827a0d504e6255c Mon Sep 17 00:00:00 2001 From: ditatompel Date: Fri, 31 May 2024 17:40:02 +0700 Subject: [PATCH] chore: Adding JSdoc --- frontend/src/routes/remote-nodes/logs/api-handler.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/routes/remote-nodes/logs/api-handler.js b/frontend/src/routes/remote-nodes/logs/api-handler.js index c1a2bc0..2fc802c 100644 --- a/frontend/src/routes/remote-nodes/logs/api-handler.js +++ b/frontend/src/routes/remote-nodes/logs/api-handler.js @@ -1,6 +1,9 @@ import { apiUri } from '$lib/utils/common'; -/** @param {import('@vincjo/datatables/remote/state')} state */ +/** + * @typedef {import('@vincjo/datatables/remote').State} State + * @param {State} state - The state object from the data table. + */ export const loadData = async (state) => { const response = await fetch(apiUri(`/api/v1/nodes/logs?${getParams(state)}`)); const json = await response.json(); @@ -8,12 +11,14 @@ export const loadData = async (state) => { return json.data.items ?? []; }; +/** @param {string} nodeId */ export const loadNodeInfo = async (nodeId) => { const response = await fetch(apiUri(`/api/v1/nodes/id/${nodeId}`)); const json = await response.json(); return json.data; }; +/** @param {State} state - The state object from the data table. */ const getParams = ({ pageNumber, rowsPerPage, sort, filters }) => { let params = `page=${pageNumber}&limit=${rowsPerPage}`;