Typescript support
This commit is contained in:
parent
354175ff2f
commit
0712a629a9
5 changed files with 40 additions and 7 deletions
|
|
@ -1,12 +0,0 @@
|
|||
export async function getPicsumData() {
|
||||
try {
|
||||
const response = await fetch('https://picsum.photos/v2/list');
|
||||
if (!response.ok) {
|
||||
throw new Error('Picsum API unavailable.');
|
||||
}
|
||||
const data = await response.json();
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.error("Could not fetch data:", error);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue