You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I keep getting this for the datatables I set up. The api.ts is:
importtype{State}from'@vincjo/datatables/remote';exportconstreload=async(state: State)=>{constresponse=awaitfetch(`http://127.0.0.1:3000/items?${getParams(state)}`);// Added 'http://' to the URLconstdata=awaitresponse.json();state.setTotalRows(data.length);returnapplyWildcardFilter(data,state.filters||[]);};constgetParams=(state: State)=>{const{ sort, search }=state;letparams='';// Set a high limit if all results are neededif(sort){params+=`&_sort=${sort.orderBy}&_order=${sort.direction}`;}returnparams;};constapplyWildcardFilter=(data: any[],filters: any[])=>{if(!filters.length)returndata;returndata.filter(item=>filters.every(({ filterBy, value })=>String(item[filterBy]).toLowerCase().includes(value.toLowerCase())));};
I'm calling it with import { reload } from "$lib/components/items_api"; and
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I keep getting this for the datatables I set up. The api.ts is:
I'm calling it with import { reload } from "$lib/components/items_api"; and
I'm doing this idiomatically as outlined in the "Basic Usage" section of the documentation. Not sure why it is giving me this error.
Beta Was this translation helpful? Give feedback.
All reactions