fix: error when no titre or article

This commit is contained in:
2024-12-16 13:34:05 +04:00
parent e4a294dece
commit 9e78a32d8d
+2 -6
View File
@@ -49,16 +49,12 @@ async function getData() {
})
)
if (titres.length === 0 || articles.length === 0) {
throw new Error('No data')
}
return {
titres,
articles
}
} catch {
throw new Error('Failed to fetch data')
} catch (error) {
throw new Error(error.cause)
}
}