UNPKG

refine-jsonapi

Version:

Data provider for refine with JSON:API specification. refine is a React-based framework for building internal tools, rapidly. JSON:API is a specification for building apis in JSON.

18 lines (17 loc) 396 B
export const generateSort = (sorters) => { if (sorters && sorters.length > 0) { const _sort = []; sorters.map((item) => { if (item.order === "desc") { _sort.push(`-${item.field}`); } else { _sort.push(item.field); } }); return { _sort, }; } return; };