add create plan buttons to texts list

This commit is contained in:
Yisroel Baum 2026-04-24 10:20:48 +03:00
parent 9ced96fc88
commit 39539313c9
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9

View file

@ -5,7 +5,11 @@ document.addEventListener('DOMContentLoaded', () => {
const response = await fetch('/api/texts');
const texts = await response.json();
textsList.innerHTML = texts
.map(text => '<li>' + text.name + '</li>')
.map(text =>
'<li>' + text.name +
' <button class="create-plan" data-text-id="' +
text.id + '">Create plan</button></li>'
)
.join('');
}