Skip to content

Commit

Permalink
Changed API call to refer to existing constant
Browse files Browse the repository at this point in the history
  • Loading branch information
jyan36 committed Oct 26, 2024
1 parent b6d2003 commit 1e98a6c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
2 changes: 1 addition & 1 deletion frontend/src/APIClients/Mutations/ResidentsMutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ export const DELETE_RESIDENT = gql`
notes
}
}
`;
`;
17 changes: 2 additions & 15 deletions frontend/src/components/pages/residents/ResidentModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,16 @@ import {
FormLabel,
} from "@chakra-ui/react";

import { gql, useMutation } from '@apollo/client';
import { useMutation } from '@apollo/client';
import ModalContainer from "../../common/ModalContainer";
import FormField from "../../common/FormField";
import { ADD_RESIDENT, UPDATE_RESIDENT } from "../../../APIClients/Mutations/ResidentsMutations";

type Props = {
isOpen: boolean;
setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
};

const ADD_RESIDENT = gql`
mutation AddResident($resident: CreateResidentDTO!) {
addResident(resident: $resident) {
email
firstName
lastName
residentId
birthDate
dateJoined
roomNumber
}
}
`;

const ResidentModal = ({ isOpen, setIsOpen }: Props): React.ReactElement => {

const [firstName, setFirstName] = useState("");
Expand Down

0 comments on commit 1e98a6c

Please sign in to comment.