PluginProbe
Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO / 1.4.14
Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO v1.4.14
1.4.14 1.4.13 1.4.12 1.4.11 1.4.10 1.4.9 1.4.8 1.4.7 1.4.6 1.4.5 1.4.4 1.4.3 1.4.2 1.4.1 1.4.0 1.3.54 1.3.53 1.3.52 1.3.51 1.3.50 1.3.49 1.3.48 1.3.47 1.3.46 1.3.45 All 177 releases
disco / backend / views / components / Docs / utils / fetchDocs.jsx

fetchDocs.jsx in Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO 1.4.14, at backend/views/components/Docs/utils/fetchDocs.jsx

27 lines 588 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 const getDocs = async () => {
2 try {
3 const response = await fetch(
4 'https://discoplugin.com/wp-json/wp/v2/docs?per_page=100'
5 );
6 if (!response.ok) throw new Error('Network response was not ok');
7 const data = await response.json();
8 return data;
9 } catch (err) {
10 console.error('Failed to fetch docs:', err);
11 }
12 };
13
14 const getDocsLength = async () => {
15 try {
16 const response = await getDocs();
17 return response ? response.length : 0;
18 } catch (err) {
19 console.error('Failed to fetch docs length:', err);
20 return 0;
21 }
22 };
23
24 export { getDocsLength };
25
26 export default getDocs;
27