mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-18 07:13:37 +01:00
12 lines
306 B
JavaScript
12 lines
306 B
JavaScript
|
import { useCallback } from 'react';
|
||
|
import { useRouter } from 'next/router';
|
||
|
import { del } from 'lib/web';
|
||
|
|
||
|
export default function useDelete() {
|
||
|
const { basePath } = useRouter();
|
||
|
|
||
|
return useCallback(async (url, params, headers) => {
|
||
|
return del(`${basePath}${url}`, params, headers);
|
||
|
}, []);
|
||
|
}
|