From 72b6cb38a5a68bd32ba620160161df92df13564a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20de=20Vasconcelos?= Date: Sat, 6 Aug 2022 01:29:32 +0100 Subject: [PATCH] Update index.js --- pages/planning/index.js | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/pages/planning/index.js b/pages/planning/index.js index 47c9950..0901fd9 100644 --- a/pages/planning/index.js +++ b/pages/planning/index.js @@ -13,6 +13,7 @@ import { GoSync } from 'react-icons/go'; export default function DashboardPlanning() { // + // // Get days from API const { data: daysFromDB } = useSWR('/api/planning/*'); @@ -43,9 +44,18 @@ export default function DashboardPlanning() { async function getRecipes() { try { - const vegan = await apicbaseAPI('/products/recipes?page_size=200&custom_fields={"Tipo de Receita": ["Vegan", "Vegetariana"]}', 'GET'); - const fish = await apicbaseAPI('/products/recipes?page_size=200&custom_fields={"Tipo de Receita": ["Peixe"]}', 'GET'); - const meat = await apicbaseAPI('/products/recipes?page_size=200&custom_fields={"Tipo de Receita": ["Carne"]}', 'GET'); + const vegan = await apicbaseAPI( + '/products/recipes?page_size=200&custom_fields={"Tipo de Receita": ["Vegan", "Vegetariana"]}', + 'GET' + ); + const fish = await apicbaseAPI( + '/products/recipes?page_size=200&custom_fields={"Tipo de Receita": ["Peixe"]}', + 'GET' + ); + const meat = await apicbaseAPI( + '/products/recipes?page_size=200&custom_fields={"Tipo de Receita": ["Carne"]}', + 'GET' + ); function formatRecipes(data) { return data.map((item) => ({ @@ -103,7 +113,9 @@ export default function DashboardPlanning() { // INIT AUTH async function initApicbaseAuth() { window.location.assign( - 'https://app.apicbase.com/oauth/authorize/?response_type=code&client_id=' + process.env.NEXT_PUBLIC_APICBASE_CLIENT_ID + '&scope=library' + 'https://app.apicbase.com/oauth/authorize/?response_type=code&client_id=' + + process.env.NEXT_PUBLIC_APICBASE_CLIENT_ID + + '&scope=library' ); } @@ -128,7 +140,12 @@ export default function DashboardPlanning() {
- +