sunrise-cms/handlers/admin-post/doMoveFeeDown.js

16 lines
559 B
JavaScript

import { moveFeeDown, moveFeeDownToBottom } from "../../helpers/lotOccupancyDB/moveFeeDown.js";
import { getFeeCategories } from "../../helpers/lotOccupancyDB/getFeeCategories.js";
export const handler = async (request, response) => {
const success = request.body.moveToBottom === "1"
? moveFeeDownToBottom(request.body.feeId)
: moveFeeDown(request.body.feeId);
const feeCategories = getFeeCategories({}, {
includeFees: true
});
response.json({
success,
feeCategories
});
};
export default handler;