Skip to content

Commit

Permalink
Remove unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
SchrodingersGat committed Sep 30, 2024
1 parent e9640f4 commit d05dcd7
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions src/frontend/src/components/editors/NotesEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> {
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
Expand Down

0 comments on commit d05dcd7

Please sign in to comment.