- Add Nuxt 3 + Prisma + SQLite full-stack setup - Add student CRUD API with batch import/export - Add stats dashboard with gender/class distribution - Add target community settings feature - Add Docker deployment support (Dockerfile + docker-compose) - Add README with development and deployment instructions
24 lines
634 B
TypeScript
24 lines
634 B
TypeScript
import { prisma } from '~/server/utils/prisma'
|
|
|
|
export default defineEventHandler(async (event) => {
|
|
const id = Number(event.context.params?.id)
|
|
const body = await readBody(event)
|
|
|
|
const student = await prisma.student.update({
|
|
where: { id },
|
|
data: {
|
|
className: body.className,
|
|
name: body.name,
|
|
gender: body.gender,
|
|
birthday: body.birthday || null,
|
|
address: body.address || null,
|
|
fatherName: body.fatherName || null,
|
|
fatherPhone: body.fatherPhone || null,
|
|
motherName: body.motherName || null,
|
|
motherPhone: body.motherPhone || null
|
|
}
|
|
})
|
|
|
|
return student
|
|
})
|