mirror of
https://github.com/sergeyyarkov/educt-server.git
synced 2026-10-11 10:19:20 +03:00
fix: lesson duration field updating
This commit is contained in:
parent
5a01acdb21
commit
ffdebc4f92
@ -144,12 +144,13 @@ export default class LessonRepository {
|
|||||||
|
|
||||||
if (lesson) {
|
if (lesson) {
|
||||||
/**
|
/**
|
||||||
* Update files
|
* Update fields
|
||||||
*/
|
*/
|
||||||
lesson.merge({
|
lesson.merge({
|
||||||
title: data.title,
|
title: data.title,
|
||||||
description: data.description,
|
description: data.description,
|
||||||
course_id: data.course_id,
|
course_id: data.course_id,
|
||||||
|
...(data.duration && { duration: data.duration.toFormat('HH:mm:ss') }),
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -11,7 +11,7 @@ export default class CreateCourseValidator {
|
|||||||
education_description: schema.string.nullable(),
|
education_description: schema.string.nullable(),
|
||||||
image: schema.file.optional({
|
image: schema.file.optional({
|
||||||
size: '10mb',
|
size: '10mb',
|
||||||
extnames: ['jpg', 'jpeg', 'png'],
|
extnames: ['jpg', 'jpeg', 'png', 'webp'],
|
||||||
}),
|
}),
|
||||||
teacher_id: schema.string({}, [rules.exists({ table: 'users', column: 'id' })]),
|
teacher_id: schema.string({}, [rules.exists({ table: 'users', column: 'id' })]),
|
||||||
category_id: schema.string({}, [rules.exists({ table: 'categories', column: 'id' })]),
|
category_id: schema.string({}, [rules.exists({ table: 'categories', column: 'id' })]),
|
||||||
|
|||||||
@ -10,7 +10,7 @@ export default class UpdateCourseValidator {
|
|||||||
education_description: schema.string.nullable(),
|
education_description: schema.string.nullable(),
|
||||||
image: schema.file.optional({
|
image: schema.file.optional({
|
||||||
size: '10mb',
|
size: '10mb',
|
||||||
extnames: ['jpg', 'jpeg', 'png'],
|
extnames: ['jpg', 'jpeg', 'png', 'webp'],
|
||||||
}),
|
}),
|
||||||
teacher_id: schema.string.optional({}, [rules.exists({ table: 'users', column: 'id' })]),
|
teacher_id: schema.string.optional({}, [rules.exists({ table: 'users', column: 'id' })]),
|
||||||
category_id: schema.string.optional({}, [rules.exists({ table: 'categories', column: 'id' })]),
|
category_id: schema.string.optional({}, [rules.exists({ table: 'categories', column: 'id' })]),
|
||||||
|
|||||||
@ -1,30 +1,17 @@
|
|||||||
{
|
{
|
||||||
"extends": "./node_modules/adonis-preset-ts/tsconfig",
|
"extends": "./node_modules/adonis-preset-ts/tsconfig",
|
||||||
"include": [
|
"include": ["**/*"],
|
||||||
"**/*"
|
"exclude": ["node_modules", "build"],
|
||||||
],
|
|
||||||
"exclude": [
|
|
||||||
"node_modules",
|
|
||||||
"build"
|
|
||||||
],
|
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "build",
|
"outDir": "build",
|
||||||
"rootDir": "./",
|
"rootDir": "./",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"useDefineForClassFields": true,
|
"useDefineForClassFields": true,
|
||||||
"paths": {
|
"paths": {
|
||||||
"App/*": [
|
"App/*": ["./app/*"],
|
||||||
"./app/*"
|
"Config/*": ["./config/*"],
|
||||||
],
|
"Contracts/*": ["./contracts/*"],
|
||||||
"Config/*": [
|
"Database/*": ["./database/*"]
|
||||||
"./config/*"
|
|
||||||
],
|
|
||||||
"Contracts/*": [
|
|
||||||
"./contracts/*"
|
|
||||||
],
|
|
||||||
"Database/*": [
|
|
||||||
"./database/*"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"types": [
|
"types": [
|
||||||
"@adonisjs/core",
|
"@adonisjs/core",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user