mattmilburn / strapi-plugin-menus

A plugin for Strapi CMS to customize the structure of menus and menu items.
MIT License
110 stars 27 forks source link

Error deleting menu #150

Closed djordje41 closed 7 months ago

djordje41 commented 7 months ago

When trying to delete simple menu I just created, I get this error in console: image No request has been sent to the server.

I believe it has to do with fetchClient we are using for performing strapi requests. In the useFetchClient.d.ts we have this:

declare const useFetchClient: () => {
    get: <TData = any, R = import("axios").AxiosResponse<TData, any>, TSend = any>(url: string, config?: import("axios").AxiosRequestConfig<TSend> | undefined) => Promise<R>;
    put: <TData_1 = any, R_1 = import("axios").AxiosResponse<TData_1, any>, TSend_1 = any>(url: string, data?: TSend_1 | undefined, config?: import("axios").AxiosRequestConfig<TSend_1> | undefined) => Promise<R_1>;
    post: <TData_2 = any, R_2 = import("axios").AxiosResponse<TData_2, any>, TSend_2 = any>(url: string, data?: TSend_2 | undefined, config?: import("axios").AxiosRequestConfig<TSend_2> | undefined) => Promise<R_2>;
    del: <TData_3 = any, R_3 = import("axios").AxiosResponse<TData_3, any>, TSend_3 = any>(url: string, config?: import("axios").AxiosRequestConfig<TSend_3> | undefined) => Promise<R_3>;
};
export { useFetchClient };
//# sourceMappingURL=useFetchClient.d.ts.map

But we are trying to do this: fetchClient.delete(getRequestUrl(id)) (admin/src/pages/IndexView/index.js: line 97). I changed delete to del and it worked locally.

mattmilburn commented 7 months ago

Hi @djordje41 Thank you so much for pointing this out! I'll make a PR for this quick fix this and I'll be deploying a new patch version of the plugin today πŸ‘πŸ»

djordje41 commented 7 months ago

You are welcome! Thank you for a rapid response!

mattmilburn commented 7 months ago

Hi again @djordje41 This bug is now fixed in the latest version 1.6.1 of the plugin πŸŽ‰