hidden-sapphireH
Refine2y ago
3 replies
hidden-sapphire

Create a custom hook like useMany or useOne without sending ids

I have this
    const { data } = useMany<any, HttpError>({
        ids: [],
        resource: RESOURCES.WEB_FORM_LOCATIONS,
    });

And this
    const { data } = useOne<any, HttpError>({
        id: 0,
        resource: RESOURCES.WEB_FORM_LOCATIONS,
    });

But I want to have something like

    const { data } = useGet<any, HttpError>({
        resource: RESOURCES.WEB_FORM_LOCATIONS,
    });

To avoid sendig and empty array of ids or an invalid id.
Was this page helpful?