cityssm/parking-ticket-system

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

Summary

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