Skip to content

Commit

Permalink
updated components where necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
bigabig committed Sep 26, 2024
1 parent d7b2963 commit c54ceb2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useEffect, useMemo, useState } from "react";
import LLMHooks from "../../../../api/LLMHooks.ts";
import { AnnotationLLMJobResult } from "../../../../api/openapi/models/AnnotationLLMJobResult.ts";
import { CodeRead } from "../../../../api/openapi/models/CodeRead.ts";
import { SpanAnnotationCreateBulkWithCodeId } from "../../../../api/openapi/models/SpanAnnotationCreateBulkWithCodeId.ts";
import { SpanAnnotationCreate } from "../../../../api/openapi/models/SpanAnnotationCreate.ts";
import { SpanAnnotationReadResolved } from "../../../../api/openapi/models/SpanAnnotationReadResolved.ts";
import SpanAnnotationHooks from "../../../../api/SpanAnnotationHooks.ts";
import { useAuth } from "../../../../auth/useAuth.ts";
Expand Down Expand Up @@ -99,7 +99,7 @@ function AnnotationResultStep() {
});
}
return acc;
}, [] as SpanAnnotationCreateBulkWithCodeId[]),
}, [] as SpanAnnotationCreate[]),
},
{
onSuccess: () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useMutation } from "@tanstack/react-query";
import { FAKE_BBOX_ID } from "../../../api/BboxAnnotationHooks.ts";
import { BBoxAnnotationRead } from "../../../api/openapi/models/BBoxAnnotationRead.ts";
import { BBoxAnnotationReadResolved } from "../../../api/openapi/models/BBoxAnnotationReadResolved.ts";
import { BBoxAnnotationUpdateWithCodeId } from "../../../api/openapi/models/BBoxAnnotationUpdateWithCodeId.ts";
import { BBoxAnnotationUpdate } from "../../../api/openapi/models/BBoxAnnotationUpdate.ts";
import { BboxAnnotationService } from "../../../api/openapi/services/BboxAnnotationService.ts";
import { QueryKey } from "../../../api/QueryKey.ts";
import queryClient from "../../../plugins/ReactQueryClient.ts";
Expand Down Expand Up @@ -66,7 +66,7 @@ export const useUpdateBBoxAnnotation = (visibleUserIds: number[]) =>
useMutation({
mutationFn: (variables: {
bboxToUpdate: BBoxAnnotationRead | BBoxAnnotationReadResolved;
requestBody: BBoxAnnotationUpdateWithCodeId;
requestBody: BBoxAnnotationUpdate;
resolve?: boolean | undefined;
}) =>
BboxAnnotationService.updateById({
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/views/annotation/TextAnnotator/TextAnnotator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { FAKE_ANNOTATION_ID } from "../../../api/SpanAnnotationHooks.ts";
import { BBoxAnnotationReadResolved } from "../../../api/openapi/models/BBoxAnnotationReadResolved.ts";
import { CodeRead } from "../../../api/openapi/models/CodeRead.ts";
import { SourceDocumentWithDataRead } from "../../../api/openapi/models/SourceDocumentWithDataRead.ts";
import { SpanAnnotationCreateWithCodeId } from "../../../api/openapi/models/SpanAnnotationCreateWithCodeId.ts";
import { SpanAnnotationCreate } from "../../../api/openapi/models/SpanAnnotationCreate.ts";
import { SpanAnnotationReadResolved } from "../../../api/openapi/models/SpanAnnotationReadResolved.ts";
import { useAuth } from "../../../auth/useAuth.ts";
import ConfirmationAPI from "../../../components/ConfirmationDialog/ConfirmationAPI.ts";
Expand All @@ -32,7 +32,7 @@ function TextAnnotator({ sdoc }: AnnotatorRemasteredProps) {

// local state
const spanMenuRef = useRef<CodeSelectorHandle>(null);
const [fakeAnnotation, setFakeAnnotation] = useState<SpanAnnotationCreateWithCodeId | undefined>(undefined);
const [fakeAnnotation, setFakeAnnotation] = useState<SpanAnnotationCreate | undefined>(undefined);

// global client state (redux)
const visibleUserIds = useAppSelector((state) => state.annotations.visibleUserIds);
Expand Down Expand Up @@ -139,7 +139,7 @@ function TextAnnotator({ sdoc }: AnnotatorRemasteredProps) {
.map((t) => t.text)
.join(" ");

const requestBody: SpanAnnotationCreateWithCodeId = {
const requestBody: SpanAnnotationCreate = {
code_id: codes[0].id,
user_id: user.id,
sdoc_id: sdoc.id,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useMutation } from "@tanstack/react-query";
import { SpanAnnotationRead } from "../../../api/openapi/models/SpanAnnotationRead.ts";
import { SpanAnnotationReadResolved } from "../../../api/openapi/models/SpanAnnotationReadResolved.ts";
import { SpanAnnotationUpdateWithCodeId } from "../../../api/openapi/models/SpanAnnotationUpdateWithCodeId.ts";
import { SpanAnnotationUpdate } from "../../../api/openapi/models/SpanAnnotationUpdate.ts";
import { SpanAnnotationService } from "../../../api/openapi/services/SpanAnnotationService.ts";
import { QueryKey } from "../../../api/QueryKey.ts";
import { FAKE_ANNOTATION_ID } from "../../../api/SpanAnnotationHooks.ts";
Expand Down Expand Up @@ -87,7 +87,7 @@ export const useUpdateSpanAnnotation = (visibleUserIds: number[]) =>
useMutation({
mutationFn: (variables: {
spanAnnotationToUpdate: SpanAnnotationRead | SpanAnnotationReadResolved;
requestBody: SpanAnnotationUpdateWithCodeId;
requestBody: SpanAnnotationUpdate;
resolve?: boolean | undefined;
}) =>
SpanAnnotationService.updateById({
Expand Down

0 comments on commit c54ceb2

Please sign in to comment.