From ccd8a520eb461fcace7b78b54e4300401fd010a2 Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 1 Oct 2024 00:10:12 +1000 Subject: [PATCH] Remove unused function (#8221) --- .../src/components/editors/NotesEditor.tsx | 33 ------------------- 1 file changed, 33 deletions(-) diff --git a/src/frontend/src/components/editors/NotesEditor.tsx b/src/frontend/src/components/editors/NotesEditor.tsx index 5cd3382795..512a06c72f 100644 --- a/src/frontend/src/components/editors/NotesEditor.tsx +++ b/src/frontend/src/components/editors/NotesEditor.tsx @@ -12,39 +12,6 @@ import { ModelType } from '../../enums/ModelType'; import { apiUrl } from '../../states/ApiState'; import { ModelInformationDict } from '../render/ModelType'; -/* - * Upload an drag-n-dropped image to the server against a model type and instance. - */ -async function uploadNotesImage( - image: File, - modelType: ModelType, - modelId: number -): Promise { - const formData = new FormData(); - formData.append('image', image); - - formData.append('model_type', modelType); - formData.append('model_id', modelId.toString()); - - const response = await api - .post(apiUrl(ApiEndpoints.notes_image_upload), formData, { - headers: { - 'Content-Type': 'multipart/form-data' - } - }) - .catch(() => { - notifications.hide('notes'); - notifications.show({ - title: t`Error`, - message: t`Image upload failed`, - color: 'red', - id: 'notes' - }); - }); - - return response?.data?.image ?? ''; -} - /* * A text editor component for editing notes against a model type and instance. * Uses the react-simple-mde editor: https://github.com/RIP21/react-simplemde-editor