I want to have only two field in object returned from API.
How to filter out these two fields, leaving others out?
type Todo = {
id: string;
title: string;
};
const url = 'https://jsonplaceholder.typicode.com/todos/1';
const fetchData = async (): Promise<any> => {
const response: AxiosResponse = await axios.get<Todo>(url);
const responseData: Todo = response.data;
return responseData;
};
fetchData().then((r) => {
console.log(r);
});```