cityssm/parking-ticket-system

View on GitHub
handlers/plates-post/doClearLookupBatch.js

Summary

Maintainability
A
2 hrs
Test Coverage
A
100%
import clearLookupBatch from '../../database/parkingDB/clearLookupBatch.js';
import getLookupBatch from '../../database/parkingDB/getLookupBatch.js';
export default function handler(request, response) {
    const batchId = Number.parseInt(request.body.batchId, 10);
    const result = clearLookupBatch(batchId, request.session.user);
    if (result.success) {
        result.batch = getLookupBatch(batchId);
    }
    response.json(result);
}