mirror of
https://github.com/rjNemo/ticket_manager
synced 2026-06-12 11:46:40 +00:00
fix bug in NewTicket Form
This commit is contained in:
parent
c3dca8edef
commit
14bb8af68c
8 changed files with 10 additions and 16 deletions
BIN
app.db
BIN
app.db
Binary file not shown.
|
|
@ -11,7 +11,6 @@ import ProjectCard from "../Cards/ProjectCard";
|
||||||
import FloatingButton from "../Buttons/FloatingButton";
|
import FloatingButton from "../Buttons/FloatingButton";
|
||||||
import NewProjectModal from "../Modals/NewProjectModal";
|
import NewProjectModal from "../Modals/NewProjectModal";
|
||||||
import Project from "../../types/Project";
|
import Project from "../../types/Project";
|
||||||
import User from "../../types/User";
|
|
||||||
|
|
||||||
const useStyles = makeStyles((theme: Theme) =>
|
const useStyles = makeStyles((theme: Theme) =>
|
||||||
createStyles({
|
createStyles({
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,8 @@
|
||||||
import React, { FC, useState, FormEvent } from "react";
|
import React, { FC, useState, FormEvent } from "react";
|
||||||
import { TextField } from "@material-ui/core";
|
import { TextField } from "@material-ui/core";
|
||||||
import Modal from "./Modal";
|
|
||||||
import Project from "../../types/Project";
|
|
||||||
import User from "../../types/User";
|
|
||||||
import { post } from "../../utils/http";
|
|
||||||
import Constants from "../../utils/Constants";
|
|
||||||
import { useAuth0 } from "../../authentication/auth0";
|
import { useAuth0 } from "../../authentication/auth0";
|
||||||
import { ProjectService } from "../../services";
|
import { ProjectService } from "../../services";
|
||||||
|
import Modal from "./Modal";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
show: boolean;
|
show: boolean;
|
||||||
|
|
|
||||||
|
|
@ -35,9 +35,9 @@ const NewTicketModal: FC<IProps> = ({ show, handleClose, allProjects }) => {
|
||||||
const { url } = useRouteMatch();
|
const { url } = useRouteMatch();
|
||||||
const id = url.split("/")[2];
|
const id = url.split("/")[2];
|
||||||
const [projectId, setProjectId] = useState(id);
|
const [projectId, setProjectId] = useState(id);
|
||||||
const [categoryID, setCategoryID] = useState(0);
|
const [categoryID, setCategoryID] = useState(1);
|
||||||
const [impactID, setImpactID] = useState(0);
|
const [impactID, setImpactID] = useState(1);
|
||||||
const [difficultyID, setDifficultyID] = useState(0);
|
const [difficultyID, setDifficultyID] = useState(1);
|
||||||
const { getTokenSilently, user } = useAuth0();
|
const { getTokenSilently, user } = useAuth0();
|
||||||
|
|
||||||
const handleSubmit = async (e: FormEvent) => {
|
const handleSubmit = async (e: FormEvent) => {
|
||||||
|
|
@ -157,7 +157,7 @@ const NewTicketModal: FC<IProps> = ({ show, handleClose, allProjects }) => {
|
||||||
className={classes.select}
|
className={classes.select}
|
||||||
>
|
>
|
||||||
{Category.map((c: string, i: number) => (
|
{Category.map((c: string, i: number) => (
|
||||||
<MenuItem key={i} value={i}>
|
<MenuItem key={i} value={i + 1}>
|
||||||
{c}
|
{c}
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
))}
|
))}
|
||||||
|
|
@ -178,7 +178,7 @@ const NewTicketModal: FC<IProps> = ({ show, handleClose, allProjects }) => {
|
||||||
margin="normal"
|
margin="normal"
|
||||||
>
|
>
|
||||||
{Impact.map((c: string, i: number) => (
|
{Impact.map((c: string, i: number) => (
|
||||||
<MenuItem key={i} value={i}>
|
<MenuItem key={i} value={i + 1}>
|
||||||
{c}
|
{c}
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
))}
|
))}
|
||||||
|
|
@ -199,7 +199,7 @@ const NewTicketModal: FC<IProps> = ({ show, handleClose, allProjects }) => {
|
||||||
margin="normal"
|
margin="normal"
|
||||||
>
|
>
|
||||||
{Difficulty.map((c: string, i: number) => (
|
{Difficulty.map((c: string, i: number) => (
|
||||||
<MenuItem key={i} value={i}>
|
<MenuItem key={i} value={i + 1}>
|
||||||
{c}
|
{c}
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
))}
|
))}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ import ProjectList from "../Lists/ProjectList";
|
||||||
import TicketList from "../Lists/TicketList";
|
import TicketList from "../Lists/TicketList";
|
||||||
import Ticket from "../../types/Ticket";
|
import Ticket from "../../types/Ticket";
|
||||||
import Project from "../../types/Project";
|
import Project from "../../types/Project";
|
||||||
import User from "../../types/User";
|
|
||||||
|
|
||||||
interface TabProps {
|
interface TabProps {
|
||||||
children?: ReactNode;
|
children?: ReactNode;
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ const ProjectController: FC = () => {
|
||||||
setHasError(true);
|
setHasError(true);
|
||||||
setError("Bad Request");
|
setError("Bad Request");
|
||||||
}
|
}
|
||||||
}, [id]);
|
}, [id, getTokenSilently]);
|
||||||
|
|
||||||
if (hasError) {
|
if (hasError) {
|
||||||
return <ErrorController error={error} />;
|
return <ErrorController error={error} />;
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ const TicketController: FC = () => {
|
||||||
setHasError(true);
|
setHasError(true);
|
||||||
setError("Bad Request");
|
setError("Bad Request");
|
||||||
}
|
}
|
||||||
}, [id]);
|
}, [id, getTokenSilently]);
|
||||||
|
|
||||||
if (hasError) {
|
if (hasError) {
|
||||||
return <ErrorController error={error} />;
|
return <ErrorController error={error} />;
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ const UserController: FC = () => {
|
||||||
setHasError(true);
|
setHasError(true);
|
||||||
setError("Bad Request");
|
setError("Bad Request");
|
||||||
}
|
}
|
||||||
}, [id]);
|
}, [id, getTokenSilently]);
|
||||||
|
|
||||||
if (hasError) {
|
if (hasError) {
|
||||||
return <ErrorController error={error} />;
|
return <ErrorController error={error} />;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue