mirror of
https://github.com/inventree/InvenTree.git
synced 2026-09-02 19:08:47 +00:00
Updated API endpoints for NotesImage model
This commit is contained in:
@@ -253,7 +253,7 @@ export enum ApiEndpoints {
|
||||
project_code_list = 'project-code/',
|
||||
custom_unit_list = 'units/',
|
||||
note_list = 'note/',
|
||||
notes_image_upload = 'notes-image-upload/',
|
||||
notes_image_list = 'notes-image/',
|
||||
email_list = 'admin/email/',
|
||||
email_test = 'admin/email/test/',
|
||||
config_list = 'admin/config/',
|
||||
|
||||
@@ -120,11 +120,11 @@ export default function NotesEditor({
|
||||
const uploadFile = useCallback(
|
||||
(file: File) => {
|
||||
const formData = new FormData();
|
||||
formData.append('note', String(selectedNoteId));
|
||||
formData.append('note', selectedNoteId?.toString() ?? '');
|
||||
formData.append('image', file);
|
||||
|
||||
return api
|
||||
.post(apiUrl(ApiEndpoints.notes_image_upload), formData, {
|
||||
.post(apiUrl(ApiEndpoints.notes_image_list), formData, {
|
||||
headers: { 'Content-Type': 'multipart/form-data' }
|
||||
})
|
||||
.then((response) => response.data.image);
|
||||
|
||||
Reference in New Issue
Block a user