mirror of
https://github.com/svemagie/indiekit-endpoint-microsub.git
synced 2026-04-02 15:35:00 +02:00
fix: correct API URL for individual mark-read
The JavaScript was POSTing to /microsub/reader but the Microsub API is at /microsub. Fixed by computing parent path from baseUrl. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -119,6 +119,9 @@
|
||||
|
||||
// Handle individual mark-read buttons
|
||||
const channelUid = timeline.dataset.channel;
|
||||
// Microsub API is at the parent of /reader (e.g., /microsub not /microsub/reader)
|
||||
const microsubApiUrl = '{{ baseUrl }}'.replace(/\/reader$/, '');
|
||||
|
||||
timeline.addEventListener('click', async (e) => {
|
||||
const button = e.target.closest('.item-actions__mark-read');
|
||||
if (!button) return;
|
||||
@@ -139,7 +142,7 @@
|
||||
formData.append('channel', channelUid);
|
||||
formData.append('entry', itemId);
|
||||
|
||||
const response = await fetch('{{ baseUrl }}', {
|
||||
const response = await fetch(microsubApiUrl, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
|
||||
Reference in New Issue
Block a user