xxxxxxxxxx
interface ResultItem {
id: string;
urls: {
small: string;
};
alt_description: string;
user: {
name: string;
};
}
interface PhotoModel {
id: string
src: string
description: string
name: string
favorited: boolean
}
data.results.map((item: ResultItem): PhotoModel => {
return {
id: item.id,
src: item.urls.small,
description: item.alt_description,
name: item.user.name,
favorited: false
}
})