Added teacher registration
This commit is contained in:
parent
d869738c21
commit
efc709a951
|
@ -86,6 +86,15 @@ module MW
|
|||
id
|
||||
end
|
||||
|
||||
@[GraphQL::Field]
|
||||
def register_teacher(context : Context, input : TeacherInput) : Teacher
|
||||
context.teacher? external: false
|
||||
|
||||
Teacher.new(
|
||||
Db::Teacher.create!(user_id: context.user.not_nil!.id, max_students: input.max_students, skif: input.skif)
|
||||
)
|
||||
end
|
||||
|
||||
@[GraphQL::Field]
|
||||
def create_student(context : Context, input : StudentCreateInput) : Student
|
||||
context.admin!
|
||||
|
|
Loading…
Reference in a new issue