Skip to content

Commit

Permalink
Fix type issues (error messages can be strings)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaaax committed Nov 20, 2024
1 parent a28acde commit b43fd9e
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function toggleTransverseComment() {
const notify = useNotifications();
const errorMessage: Ref<FileErrorMessage | null> = ref(null);
const errorMessage: Ref<FileErrorMessage | string | null> = ref(null);
const criteriumNotCompliantAccordion =
ref<InstanceType<typeof CriteriumNotCompliantAccordion>>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import MarkdownHelpButton from "./MarkdownHelpButton.vue";
export interface Props {
id: string;
comment: string | null;
errorMessage?: FileErrorMessage | null;
errorMessage?: FileErrorMessage | string | null;
exampleImages: AuditFile[];
quickWin?: boolean;
userImpact: CriterionResultUserImpact | null;
Expand Down
2 changes: 1 addition & 1 deletion confiture-web-app/src/components/audit/NotesModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ defineExpose({
hide: () => modal.value?.hide()
});
const errorMessage: Ref<FileErrorMessage | null> = ref(null);
const errorMessage: Ref<FileErrorMessage | string | null> = ref(null);
const fileUpload = ref<InstanceType<typeof FileUpload>>();
const auditStore = useAuditStore();
Expand Down
2 changes: 1 addition & 1 deletion confiture-web-app/src/components/ui/FileUpload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { formatBytes, getUploadUrl } from "../../utils";
export interface Props {
acceptedFormats?: Array<string>;
auditFiles: AuditFile[];
errorMessage?: FileErrorMessage | null;
errorMessage?: FileErrorMessage | string | null;
maxFileSize?: string;
multiple?: boolean;
readonly?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion confiture-web-app/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export async function handleFileUploadError(
error: Error
): Promise<FileErrorMessage | string> {
if (error instanceof HTTPError) {
let errorType: FileErrorMessage | null = null;
let errorType: FileErrorMessage;
if (error.response.status === 413) {
errorType = FileErrorMessage.UPLOAD_SIZE;
}
Expand Down

0 comments on commit b43fd9e

Please sign in to comment.