Changeset 084d1c0 in Klonkt for src/routes/admin-audio.js


Ignore:
Timestamp:
06/30/2026 02:10:36 AM (2 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
e0a1ec1
Parents:
f2eacca
Message:

fix(admin-audio): fediverse-share toggle is now AJAX (no page jump)

The new per-track fedi-share toggle used a form POST + redirect, so clicking it reloaded the
page and jumped to the top. It now toggles via AJAX in place, mirroring the download toggle.

  • src/views/pages/admin-audio.ejs — fedi button -> data-track-fedi + an AJAX click handler
  • src/routes/admin-audio.js — the /api/:id field-update route now accepts fedi_open

Co-Authored-By: Claude <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/routes/admin-audio.js

    rf2eacca r084d1c0  
    494494    fields.push('downloadable = ?'); values.push(body.downloadable ? 1 : 0);
    495495  }
     496  if (Object.prototype.hasOwnProperty.call(body, 'fedi_open')) {
     497    fields.push('fedi_open = ?'); values.push(body.fedi_open ? 1 : 0);
     498  }
    496499  if (Object.prototype.hasOwnProperty.call(body, 'credit')) {
    497500    fields.push('credit = ?'); values.push(String(body.credit || '').trim() || null);
Note: See TracChangeset for help on using the changeset viewer.