mirror of
https://github.com/ditatompel/xmr-remote-nodes.git
synced 2025-01-08 20:09:43 +00:00
chore: Adding JSdoc
This commit is contained in:
parent
009faa6aa8
commit
db2d2195e9
1 changed files with 6 additions and 1 deletions
|
@ -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}`;
|
||||
|
||||
|
|
Loading…
Reference in a new issue