UNPKG

strapi-plugin-publisher

Version:

A plugin for Strapi Headless CMS that provides the ability to schedule publishing for any content type.

25 lines (20 loc) 477 B
import { useQuery } from 'react-query'; import { useFetchClient } from '@strapi/helper-plugin'; import { pluginId } from '../pluginId'; export const useSettings = () => { const { get } = useFetchClient(); function getSettings() { return useQuery({ queryKey: [pluginId, 'settings'], queryFn: function () { return get(`/${pluginId}/settings`); }, select: function ({ data }) { return data.data || false; }, }); } return { getSettings, }; };