Add API route for training
This commit is contained in:
@@ -116,7 +116,7 @@ export function InstructorClassDetail(props) {
|
||||
};
|
||||
|
||||
export function InstructorClassList(props) {
|
||||
const { course, setCourse, token, user } = props;
|
||||
const { course, setCourse, token } = props;
|
||||
const [open, setOpen] = useState(false);
|
||||
const [input, setInput] = useState({});
|
||||
const [error, setError] = useState(false);
|
||||
@@ -126,7 +126,7 @@ export function InstructorClassList(props) {
|
||||
const handleSubmit = (e) => {
|
||||
setLoading(true);
|
||||
setSuccess(false);
|
||||
const data = { ...input, instructor: user.id, course: course.id };
|
||||
const data = { ...input, course: course.id };
|
||||
requester('/sessions/', 'POST', token, data)
|
||||
.then(res => {
|
||||
setSuccess(res.id);
|
||||
|
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
|
||||
import { Table } from 'semantic-ui-react';
|
||||
|
||||
export const isAdmin = (user) => user.is_staff || user.member.is_director || user.member.is_staff;
|
||||
export const isInstructor = (user) => isAdmin(user) || user.member.is_staff;
|
||||
export const isInstructor = (user) => isAdmin(user) || user.member.is_instructor;
|
||||
|
||||
export const siteUrl = window.location.protocol + '//' + window.location.hostname;
|
||||
export const apiUrl = window.location.protocol + '//api.' + window.location.hostname;
|
||||
|
Reference in New Issue
Block a user