cityssm/parking-ticket-system

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

Summary

Maintainability
A
1 hr
Test Coverage
A
100%
import addParkingLocation from '../../database/parkingDB/addParkingLocation.js';
import { getParkingLocations } from '../../helpers/functions.cache.js';
export default function handler(request, response) {
    const results = addParkingLocation(request.body);
    if (results.success) {
        results.locations = getParkingLocations();
    }
    response.json(results);
}