Adapt components with API response
This commit is contained in:
@@ -27,12 +27,13 @@ export default function ChecheAwtis() {
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
const data = await jwennToutAwtis()
|
||||
const {data} = await jwennToutAwtis()
|
||||
|
||||
const filteredData = data.map(artiste => {
|
||||
const firstLetter = artiste.attributes.alias[0].toUpperCase()
|
||||
const firstLetter = artiste.alias[0].toUpperCase()
|
||||
return {
|
||||
firstLetter: /\d/.test(firstLetter) ? '0-9' : firstLetter,
|
||||
...artiste.attributes
|
||||
...artiste
|
||||
}
|
||||
})
|
||||
if (active) {
|
||||
|
||||
Reference in New Issue
Block a user