const dateTwoMonthsBack = new Date();
dateTwoMonthsBack.setMonth(dateTwoMonthsBack.getMonth() - 2);
const id = 'testId'; // TODO: remove
const params = {
page_size: 200,
manager: id,
last_kpi_graded__lte: dateTwoMonthsBack.toISOString().substring(0, 10),
};
const url =
'http://10.1.5.65/api/personal/users/?' +
Object.entries(params)
.map(([k, v]) => `${k}=${encodeURIComponent(v)}`)
.join('&');
console.log(url);
// http://10.1.5.65/api/personal/users/?page_size=200&manager=testId&last_kpi_graded__lte=2022-09-16
// fetch(url);