cityssm/lottery-licence-manager

View on GitHub
handlers/locations-post/doDelete.js

Summary

Maintainability
A
2 hrs
Test Coverage
F
28%
import { deleteLocation } from "../../helpers/licencesDB/deleteLocation.js";
export const handler = (request, response) => {
    const changeCount = deleteLocation(request.body.locationID, request.session);
    return changeCount
        ? response.json({
            success: true,
            message: "Location deleted successfully."
        })
        : response.json({
            success: false,
            message: "Location could not be deleted."
        });
};
export default handler;