auto update templates

This commit is contained in:
matan
2024-01-19 11:27:51 +02:00
parent 3e291f779f
commit c8fe148473
3 changed files with 230 additions and 18 deletions
+17
View File
@@ -194,3 +194,20 @@ export const modules = [
}))
]
fetch("https://openart.ai/api/public/templates/list").then(res=>res.json()).then(res=>{
res.map(template => {
const t = ({
id: template.id,
title: template.name,
description: template.description,
type: 'template',
thumbnail: template.thumbnails[0].url,
categories: [categories[1]],
})
if(!modules.find(m=>m.id===t.id)){
modules.push(t)
}
}
)})
+210 -2
View File
File diff suppressed because one or more lines are too long