add view for single text

This commit is contained in:
Yisroel Baum 2026-04-17 09:22:55 +03:00
parent 5b2d85fb92
commit 68da48aedd
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
4 changed files with 30 additions and 0 deletions

9
public/js/text.js Normal file
View file

@ -0,0 +1,9 @@
document.addEventListener('DOMContentLoaded', () => {
const textId = window.location.pathname.split('/').pop();
fetch('/api/texts/' + textId)
.then(res => res.json())
.then(text => {
document.getElementById('text-detail').textContent = text.name;
});
});