Skip to content

Commit

Permalink
fix: Fixed build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
MathisBurger committed Oct 30, 2024
1 parent 50aedc2 commit 99e27bd
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 19 deletions.
11 changes: 0 additions & 11 deletions tasky/src/response/solution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ pub struct ListSolutionResponse {
pub submitter: User,
pub approval_status: Option<String>,
pub assignment: MinifiedAssignmentResponse,
pub job: Option<Job>,
}

/// Vec of solutions
Expand All @@ -62,21 +61,11 @@ impl Enrich<Solution> for ListSolutionResponse {
let assignment_response =
MinifiedAssignmentResponse::enrich(&assignment, client, db_conn).await?;

let mut job = None;

if assignment.language != AssignmentLanguage::QuestionBased {
job = match from.job_id.as_ref() {
Some(id) => Some(get_job(id).await?),
None => None,
};
}

Ok(ListSolutionResponse {
id: from.id,
submitter: submitter.into_inner().into(),
approval_status: from.approval_status.clone(),
assignment: assignment_response,
job,
})
}
}
Expand Down
1 change: 0 additions & 1 deletion web/app/report-bug/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import useApiServiceClient from "@/hooks/useApiServiceClient";
import {Container, Stack, Textarea, TextInput, Title, Button} from "@mantine/core";
import {useForm} from "@mantine/form";
import {GenericMessage} from "@/service/ApiService";
import {showNotification} from "@mantine/notifications";


Expand Down
4 changes: 2 additions & 2 deletions web/app/solutions/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const PersonalSolutionsPage = () => {
{
field: "approval_status",
label: "Approval Status",
render: (value, row) => (
<SolutionBadge status={value as string} job={row.job} />
render: (value) => (
<SolutionBadge status={value as string} />
),
},
];
Expand Down
4 changes: 2 additions & 2 deletions web/components/assignments/AssignmentSolutionsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ const AssignmentSolutionsTab = ({
{
field: "approval_status",
label: "Approval Status",
render: (value, row) => (
<SolutionBadge status={value as string} job={row.job} />
render: (value) => (
<SolutionBadge status={value as string} />
),
},
];
Expand Down
1 change: 0 additions & 1 deletion web/components/solution/CommentTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import useApiServiceClient from "@/hooks/useApiServiceClient";
import useClientQuery from "@/hooks/useClientQuery";
import { Solution } from "@/service/types/tasky";
import {Badge, Button, Card, Group, Stack, Title} from "@mantine/core";
import AssignmentDateDisplay from "@/components/assignments/AssignmentDateDisplay";
import RichTextDisplay from "@/components/display/RichTextDisplay";
import useCurrentUser from "@/hooks/useCurrentUser";
import {IconPlus} from "@tabler/icons-react";
Expand Down
1 change: 0 additions & 1 deletion web/components/solution/SolutionBadge.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Badge } from "@mantine/core";
import { Job } from "@/service/types/tasky";

interface SolutionBadgeProps {
status: string | null;
Expand Down
2 changes: 1 addition & 1 deletion web/service/types/tasky.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export interface Solution {
}

export interface SolutionsResponse {
solutions: Solution[];
solutions: Omit<Solution, 'job'>[];
}

export interface SolutionFilesResponse {
Expand Down

0 comments on commit 99e27bd

Please sign in to comment.