From 381da95d919f90d64235bd7235da14c8a6082573 Mon Sep 17 00:00:00 2001 From: grimhilt Date: Mon, 14 Aug 2023 01:17:15 +0200 Subject: [PATCH] fix api sub categories --- src/pages/files/add.jsx | 2 +- src/pages/files/file-selector.jsx | 6 +++--- src/pages/files/index.jsx | 2 +- src/pages/playlist/index.jsx | 4 ++-- src/pages/users/user-editor-modal.jsx | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/pages/files/add.jsx b/src/pages/files/add.jsx index 77e96b0..a0827c1 100644 --- a/src/pages/files/add.jsx +++ b/src/pages/files/add.jsx @@ -26,7 +26,7 @@ const ModalAddFile = ({ opened, handler, addFiles }) => { setIsLoading(true); const formData = new FormData(); files.forEach((file) => formData.append('file', file)); - API.upload(formData) + API.files.upload(formData) .then((res) => { if (res.status === 200) { validate(res.data); diff --git a/src/pages/files/file-selector.jsx b/src/pages/files/file-selector.jsx index 0f3ef84..f125723 100644 --- a/src/pages/files/file-selector.jsx +++ b/src/pages/files/file-selector.jsx @@ -40,7 +40,7 @@ const ModalFileSelector = ({ opened, handleClose, handleSubmit, ...props }) => { } useEffect(() => { - API.getFiles() + API.files.list() .then((res) => { if (res.status === 200) { setFiles(res.data); @@ -56,7 +56,7 @@ const ModalFileSelector = ({ opened, handleClose, handleSubmit, ...props }) => { useEffect(() => { if (search.length >= 2) { - API.searchfiles(search) + API.files.search(search) .then((res) => { if (res.status === 200) { setFiles(res.data); @@ -66,7 +66,7 @@ const ModalFileSelector = ({ opened, handleClose, handleSubmit, ...props }) => { setNotification(true, err); }); } else if (search.length === 0) { - API.getFiles() + API.files.list() .then((res) => { if (res.status === 200) { setFiles(res.data); diff --git a/src/pages/files/index.jsx b/src/pages/files/index.jsx index c90cc92..5ced79a 100644 --- a/src/pages/files/index.jsx +++ b/src/pages/files/index.jsx @@ -15,7 +15,7 @@ const Files = () => { }; useEffect(() => { - API.getFiles() + API.files.list() .then((res) => { if (res.status === 200) { setFiles(res.data); diff --git a/src/pages/playlist/index.jsx b/src/pages/playlist/index.jsx index cff0f55..6ac2d2b 100644 --- a/src/pages/playlist/index.jsx +++ b/src/pages/playlist/index.jsx @@ -58,7 +58,7 @@ const Playlist = (item) => { if (JSON.stringify(item) !== '{}') { setPlaylist(item); } else { - API.getPlaylist(id) + API.playlists.get(id) .then((res) => { if (res.status === 200) { setPlaylist(res.data); @@ -117,7 +117,7 @@ const Playlist = (item) => { - + { - console.log(e) if (e) { handler(e); } + form.reset() handlerClose(); };