Skip to content

Feature: Batch Link Management for Admins #981

@codeCraft-Ritik

Description

@codeCraft-Ritik

Issue :

Currently, the admin interface allows managing links and users one by one. If an admin needs to delete or ban 50 malicious links from a single spammer, they must do it individually, which is inefficient.
Improvement: Implement a checkbox-based batch action system in the Admin Links table.

File Path : server/handlers/links.handler.js

Code logic to add :

// Add to server/handlers/links.handler.js
async function batchRemove(req, res) {
  const { ids } = req.body; // Array of UUIDs
  if (!Array.isArray(ids) || ids.length === 0) {
    throw new CustomError("No links selected.");
  }
  
  await query.link.removeBatch({
    uuids: ids,
    ...(!req.user.admin && { user_id: req.user.id })
  });

  return res.status(200).send({ message: `${ids.length} links deleted.` });
}

Frontend : Update server/views/partials/admin/links/table.hbs to include a "Select All" checkbox in the thead and individual checkboxes in each tr

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions