JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr{ gilour

File "delete-file-entries.ts"

Full Path: /home/markqprx/iniasli.pro/client/uploads/requests/delete-file-entries.ts
File size: 719 bytes
MIME-type: text/plain
Charset: utf-8

import {useMutation} from '@tanstack/react-query';
import {BackendResponse} from '../../http/backend-response/backend-response';
import {apiClient} from '../../http/query-client';
import {showHttpErrorToast} from '../../utils/http/show-http-error-toast';

interface Response extends BackendResponse {}

interface Payload {
  entryIds?: number[];
  deleteForever?: boolean;
  paths?: string[];
}

function deleteFileEntries(payload: Payload): Promise<Response> {
  return apiClient.post('file-entries/delete', payload).then(r => r.data);
}

export function useDeleteFileEntries() {
  return useMutation({
    mutationFn: (props: Payload) => deleteFileEntries(props),
    onError: err => showHttpErrorToast(err),
  });
}