Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused function #8221

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading