sunrise-cms/handlers/lots-post/doAddLotComment.js

12 lines
430 B
JavaScript

import { addLotComment } from '../../helpers/lotOccupancyDB/addLotComment.js';
import { getLotComments } from '../../helpers/lotOccupancyDB/getLotComments.js';
export async function handler(request, response) {
await addLotComment(request.body, request.session);
const lotComments = await getLotComments(request.body.lotId);
response.json({
success: true,
lotComments
});
}
export default handler;