updated ui and file creation

This commit is contained in:
2026-03-25 14:09:15 +01:00
parent e53cdfef03
commit fe2489b4ed
5 changed files with 20 additions and 12 deletions

View File

@@ -327,7 +327,7 @@ import Layout from '../../layouts/Layout.astro';
delBtn?.addEventListener('click', async () => {
if (confirm(`Delete post "${slugInput.value}" permanently?`)) {
try {
const res = await fetch(`/api/posts/${slugInput.value}`, {
const res = await fetch(`/api/posts/${encodeURIComponent(slugInput.value)}`, {
method: 'DELETE',
headers: { 'Authorization': `Bearer ${token}` }
});