2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-28 11:36:44 +00:00

Remove unused function (#8221)

This commit is contained in:
Oliver 2024-10-01 00:10:12 +10:00 committed by GitHub
parent e9640f4f15
commit ccd8a520eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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