Skip to content

Commit

Permalink
reorganize incident response to match serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
Mustaballer committed Feb 18, 2024
1 parent 2fed5ee commit 48f78a7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,10 @@ const IncidentFormRender = ({

const handleSubmit = async (values: FormikValues, { resetForm }: any) => {
const incident: IncidentRequestBody = {
id: checkedOutOrder?.checkedOutOrderId, // to check... id is order #
state: values.state,
time_occurred: new Date(values.when).toISOString(),
description: `${values.what}\n${values.where}`,
order_item: checkedOutOrder?.id ?? 0, // order item is id?
team_id: 0,
created_at: new Date().toISOString(),
updated_at: "",
};

dispatch(createIncident(incident));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,10 @@ import { displaySnackbar } from "slices/ui/uiSlice";
import { IncidentState } from "api/types";

export interface IncidentRequestBody {
id?: number;
state: IncidentState;
time_occurred: string; //($date-time)
description: string;
order_item: number;
team_id?: number;
created_at?: string;
updated_at?: string;
}

export interface IncidentResponse {
Expand Down

0 comments on commit 48f78a7

Please sign in to comment.