qee
This commit is contained in:
parent
baa65e0e3f
commit
317df03ded
|
@ -112,8 +112,6 @@ export class PostService extends BaseTreeService<Prisma.PostDelegate> {
|
|||
return await db.$transaction(async (tx) => {
|
||||
const courseParams = { ...params, tx };
|
||||
// Create the course first
|
||||
console.log(courseParams?.staff?.id);
|
||||
console.log('courseDetail', courseDetail);
|
||||
const createdCourse = await this.create(courseDetail, courseParams);
|
||||
// If sections are provided, create them
|
||||
return createdCourse;
|
||||
|
|
|
@ -129,6 +129,7 @@ export async function updateCourseEnrollmentStats(courseId: string) {
|
|||
export async function setCourseInfo({ data }: { data: Post }) {
|
||||
// await db.term
|
||||
console.log(12314243342);
|
||||
console.log(data?.type);
|
||||
if (data?.type === PostType.COURSE) {
|
||||
const ancestries = await db.postAncestry.findMany({
|
||||
where: {
|
||||
|
|
|
@ -91,6 +91,7 @@ export function CourseFormProvider({
|
|||
|
||||
const formattedValues = {
|
||||
...values,
|
||||
type: PostType.COURSE,
|
||||
meta: {
|
||||
...((course?.meta as CourseMeta) || {}),
|
||||
...(values?.meta?.thumbnail !== undefined && {
|
||||
|
@ -111,8 +112,6 @@ export function CourseFormProvider({
|
|||
delete formattedValues.sections;
|
||||
delete formattedValues.deptIds;
|
||||
|
||||
console.log(course.meta);
|
||||
console.log(formattedValues?.meta);
|
||||
try {
|
||||
if (editId) {
|
||||
const result = await update.mutateAsync({
|
||||
|
@ -125,7 +124,7 @@ export function CourseFormProvider({
|
|||
const result = await createCourse.mutateAsync({
|
||||
courseDetail: {
|
||||
data: {
|
||||
title: formattedValues.title || "12345",
|
||||
title: formattedValues.title,
|
||||
|
||||
// state: CourseStatus.DRAFT,
|
||||
type: PostType.COURSE,
|
||||
|
|
|
@ -5,7 +5,7 @@ export enum PostType {
|
|||
POST = "post",
|
||||
POST_COMMENT = "post_comment",
|
||||
COURSE_REVIEW = "course_review",
|
||||
COURSE = "couse",
|
||||
COURSE = "course",
|
||||
SECTION = "section",
|
||||
LECTURE = "lecture",
|
||||
PATH = "path",
|
||||
|
@ -101,7 +101,6 @@ export enum RolePerms {
|
|||
}
|
||||
export enum AppConfigSlug {
|
||||
BASE_SETTING = "base_setting",
|
||||
|
||||
}
|
||||
// 资源类型的枚举,定义了不同类型的资源,以字符串值表示
|
||||
export enum ResourceType {
|
||||
|
|
|
@ -69,6 +69,7 @@ export const courseDetailSelect: Prisma.PostSelect = {
|
|||
id: true,
|
||||
title: true,
|
||||
subTitle: true,
|
||||
type: true,
|
||||
content: true,
|
||||
depts: true,
|
||||
// isFeatured: true,
|
||||
|
|
Loading…
Reference in New Issue