Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jacob-Kathleen/populate task list #121

Merged
merged 16 commits into from
Nov 16, 2024
6 changes: 6 additions & 0 deletions backend/services/implementations/taskService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@ class TaskService implements ITaskService {

async deleteTaskById(taskId: number): Promise<TaskDTO> {
try {
await prisma.taskAssigned.deleteMany({
where: {
taskId,
},
});

const deletedTask = await prisma.task.delete({
where: {
id: taskId,
Expand Down
5 changes: 5 additions & 0 deletions backend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3637,6 +3637,11 @@ fs.realpath@^1.0.0:
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8=

[email protected]:
version "2.3.3"
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6"
integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==

fsevents@^2.3.2, fsevents@~2.3.1:
version "2.3.2"
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/APIClients/Queries/TaskQueries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const GET_TASK_BY_ID = gql`
`;

export const GET_TASKS_BY_TYPE = gql`
query getTaskById($type: TaskType!) {
query getTasksByType($type: TaskType!) {
getTasksByType(type: $type) {
id
type
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/common/CommonTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import ChevronRightOutlinedIcon from "@mui/icons-material/ChevronRightOutlined";
import KeyboardArrowUpOutlinedIcon from "@mui/icons-material/KeyboardArrowUpOutlined";
import KeyboardArrowDownOutlinedIcon from "@mui/icons-material/KeyboardArrowDownOutlined";

type TableTypes = string | number | boolean | Date;
type TableTypes = string | number | boolean | Date | string[];

export type ColumnInfoTypes = { header: string; key: string };

Expand Down
10 changes: 6 additions & 4 deletions frontend/src/components/common/FormField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const FormField = ({
leftElement,
}: {
label: string;
value: string;
value: string | number | undefined;
type?: string;
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
onBlur?: () => void;
Expand All @@ -42,9 +42,11 @@ const FormField = ({
}) => (
<Flex flexDir="column" flex="1">
<FormControl isRequired={required}>
<FormLabel mb="5px" color="gray.main" fontWeight="700">
{label}
</FormLabel>
{label && (
<FormLabel mb="5px" color="gray.main" fontWeight="700">
{label}
</FormLabel>
)}
<InputGroup>
{leftElement && (
<InputLeftElement height="34px" pointerEvents="none" color="black">
Expand Down
Loading
Loading