fix api sub categories
This commit is contained in:
parent
cde6bb6b02
commit
381da95d91
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -15,7 +15,7 @@ const Files = () => {
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
API.getFiles()
|
||||
API.files.list()
|
||||
.then((res) => {
|
||||
if (res.status === 200) {
|
||||
setFiles(res.data);
|
||||
|
@ -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) => {
|
||||
</Group>
|
||||
</Group>
|
||||
<Paper p="xs" radius="sm" shadow="sm" withBorder my="md">
|
||||
<Content form={form} playlistId={id} />
|
||||
<Content form={form} playlistId={id} playlist={playlist} />
|
||||
</Paper>
|
||||
<ModalUpdate
|
||||
opened={showUpdate}
|
||||
|
@ -10,10 +10,10 @@ const ModalUserEditor = ({ opened, handlerClose, handler, APICall, name, item })
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const { user } = useAuth();
|
||||
const handleFinish = (e) => {
|
||||
console.log(e)
|
||||
if (e) {
|
||||
handler(e);
|
||||
}
|
||||
form.reset()
|
||||
handlerClose();
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user