cityssm/parking-ticket-system

View on GitHub
handlers/admin-post/doDeleteBylaw.js

Summary

Maintainability
A
1 hr
Test Coverage
A
100%
import deleteParkingBylaw from '../../database/parkingDB/deleteParkingBylaw.js';
import { getParkingBylawsWithOffenceStats } from '../../database/parkingDB/getParkingBylaws.js';
export default function handler(request, response) {
    const results = deleteParkingBylaw(request.body.bylawNumber);
    if (results.success) {
        results.bylaws = getParkingBylawsWithOffenceStats();
    }
    response.json(results);
}