sunrise-cms/handlers/admin-post/doUpdateIntermentContainerT...

25 lines
635 B
TypeScript

import type { Request, Response } from 'express'
import updateIntermentContainerType, {
type UpdateIntermentContainerTypeForm
} from '../../database/updateIntermentContainerType.js'
import { getIntermentContainerTypes } from '../../helpers/functions.cache.js'
export default function handler(
request: Request<unknown, unknown, UpdateIntermentContainerTypeForm>,
response: Response
): void {
const success = updateIntermentContainerType(
request.body,
request.session.user as User
)
const intermentContainerTypes = getIntermentContainerTypes()
response.json({
success,
intermentContainerTypes
})
}