add view for single text
This commit is contained in:
parent
5b2d85fb92
commit
68da48aedd
4 changed files with 30 additions and 0 deletions
9
public/js/text.js
Normal file
9
public/js/text.js
Normal 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;
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue