UNPKG

dobo-restproxy-ndut

Version:

Ndut Framework REST Proxy Extension for Bajo Framework

12 lines (10 loc) 329 B
async function recordFind ({ url, opts, schema, filter } = {}) { const sorts = [] for (const s in filter.sort) { sorts.push(`${s} ${filter.sort[s] === -1 ? 'DESC' : 'ASC'}`) } if (sorts.length > 0) opts.params.sort = sorts.join(',') delete filter.sort return { url, opts } } export default recordFind