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 { return {
titres, titres,
articles articles
} }
} catch { } catch (error) {
throw new Error('Failed to fetch data') throw new Error(error.cause)
} }
} }