(data: typeof CourseTable.$inferInsert)
| 4 | import { eq } from "drizzle-orm" |
| 5 | |
| 6 | export async function insertCourse(data: typeof CourseTable.$inferInsert) { |
| 7 | const [newCourse] = await db.insert(CourseTable).values(data).returning() |
| 8 | if (newCourse == null) throw new Error("Failed to create course") |
| 9 | revalidateCourseCache(newCourse.id) |
| 10 | |
| 11 | return newCourse |
| 12 | } |
| 13 | |
| 14 | export async function updateCourse( |
| 15 | id: string, |
no test coverage detected