cityssm/lottery-licence-manager

View on GitHub
handlers/locations-post/doRestore.ts

Summary

Maintainability
A
2 hrs
Test Coverage
import type { RequestHandler } from "express";

import { restoreLocation } from "../../helpers/licencesDB/restoreLocation.js";


export const handler: RequestHandler = (request, response) => {

  const changeCount = restoreLocation(request.body.locationID, request.session);

  return changeCount
    ? response.json({
      success: true,
      message: "Location restored successfully."
    })
    : response.json({
      success: false,
      message: "Location could not be restored."
    });
};


export default handler;