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) {
|
||||
/**
|
||||
* Update files
|
||||
* Update fields
|
||||
*/
|
||||
lesson.merge({
|
||||
title: data.title,
|
||||
description: data.description,
|
||||
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(),
|
||||
image: schema.file.optional({
|
||||
size: '10mb',
|
||||
extnames: ['jpg', 'jpeg', 'png'],
|
||||
extnames: ['jpg', 'jpeg', 'png', 'webp'],
|
||||
}),
|
||||
teacher_id: schema.string({}, [rules.exists({ table: 'users', 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(),
|
||||
image: schema.file.optional({
|
||||
size: '10mb',
|
||||
extnames: ['jpg', 'jpeg', 'png'],
|
||||
extnames: ['jpg', 'jpeg', 'png', 'webp'],
|
||||
}),
|
||||
teacher_id: schema.string.optional({}, [rules.exists({ table: 'users', column: 'id' })]),
|
||||
category_id: schema.string.optional({}, [rules.exists({ table: 'categories', column: 'id' })]),
|
||||
|
||||
@ -1,30 +1,17 @@
|
||||
{
|
||||
"extends": "./node_modules/adonis-preset-ts/tsconfig",
|
||||
"include": [
|
||||
"**/*"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"build"
|
||||
],
|
||||
"include": ["**/*"],
|
||||
"exclude": ["node_modules", "build"],
|
||||
"compilerOptions": {
|
||||
"outDir": "build",
|
||||
"rootDir": "./",
|
||||
"sourceMap": true,
|
||||
"useDefineForClassFields": true,
|
||||
"paths": {
|
||||
"App/*": [
|
||||
"./app/*"
|
||||
],
|
||||
"Config/*": [
|
||||
"./config/*"
|
||||
],
|
||||
"Contracts/*": [
|
||||
"./contracts/*"
|
||||
],
|
||||
"Database/*": [
|
||||
"./database/*"
|
||||
]
|
||||
"App/*": ["./app/*"],
|
||||
"Config/*": ["./config/*"],
|
||||
"Contracts/*": ["./contracts/*"],
|
||||
"Database/*": ["./database/*"]
|
||||
},
|
||||
"types": [
|
||||
"@adonisjs/core",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user