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:
parent
e9640f4f15
commit
ccd8a520eb
@ -12,39 +12,6 @@ import { ModelType } from '../../enums/ModelType';
|
|||||||
import { apiUrl } from '../../states/ApiState';
|
import { apiUrl } from '../../states/ApiState';
|
||||||
import { ModelInformationDict } from '../render/ModelType';
|
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.
|
* 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
|
* Uses the react-simple-mde editor: https://github.com/RIP21/react-simplemde-editor
|
||||||
|
Loading…
x
Reference in New Issue
Block a user