A minimalistic ClojureScript interface to React.js
4.75k
stars
415
forks
source link
@@ -62,6 +62,45 @@ class _Config {
}
}
// eslint-disable-next-line valid-jsdoc
/**
* fetch problem title, level via solved.ac api
* @see {@link https://solvedac.github.io/unofficial-documentation/#/operations/getProblemByIdArray}
* @param {string[]} pids - list of problem id (up to 100)
* @param { ({ problemId, titleKo, level }) => void } callback
*/
function fetchProblemsFromSolvedAc(pids, callback) {
const query = encodeURIComponent(pids.join(','));
console.log(`https://solved.ac/api/v3/problem/lookup?problemIds=${query}`);
fetch(`https://solved.ac/api/v3/problem/lookup?problemIds=${query}`)
.then((res) => {
console.log('fetchProblemsFromSolvedAc', res);
return res;
})
.then((res) => res.json())
.then(callback)
.catch(() => callback(null));
}
#590
Closed
fardhin78 closed 1 year ago