This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import axios from 'axios'; | |
| import { useQuery } from 'react-query'; | |
| const useTeam = (id) => { | |
| const getTeam = async () => { | |
| const data = await axios.get(`/teams/${id}`); | |
| return data; | |
| } | |
| const { data, isLoading } = useQuery(['team', id], getTeam); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import axios from 'axios'; | |
| import { useQuery } from 'react-query'; | |
| const useTeam = (id) => { | |
| const query = async () => { | |
| const data = await axios.get(`/teams/${id}`); | |
| return data; | |
| } | |
| const { data, isLoading } = useQuery(['team', id], query); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import axios from 'axios'; | |
| import { useQuery } from 'react-query'; | |
| const query = async ({queryKey}) => { | |
| const [_, id] = queryKey; | |
| const data = await axios.get(`/teams/${id}`); | |
| return data; | |
| } | |
| const useTeam = (id) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const useExercises = (muscleGroup) => { | |
| const fetchExercises = async () => { | |
| const data = await axios.get('/exercises', {params: {muscleGroup}}); | |
| return data; | |
| } | |
| const onError = (error) => { | |
| console.error(error); | |
| } | |
| const { data, isLoading } = useQuery( | |
| ['exercises', muscleGroup], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const ExerciseList = () => { | |
| const fetchBackExercises = async () => { | |
| const data = await axios.get('/exercises', {params: {muscleGroup: 'back'}}); | |
| return data; | |
| } | |
| const onError = (error) => { | |
| console.error(error); | |
| } | |
| const { data = [], isLoading } = useQuery( | |
| ['exercises', 'back'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fetchBackExercises = async () => { | |
| const data = await axios.get('/exercises', {params: {muscleGroup: 'back'}}); | |
| return data; | |
| } | |
| const onError = (error) => { | |
| console.error(error); | |
| } | |
| const { data, isLoading } = useQuery( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Endpoint for associating sucessfully created Stripe subscription | |
| # with the Adult document. Needs body with paymentMethodId (from | |
| # Stripe in frontend), priceId (from frontend, matches the priceId | |
| # for selected option in Stripe), and childId (probably will be changed | |
| # to create child here?) | |
| @stripe_blueprint.route('/create_subscription', methods=['POST']) | |
| def createSubscription(): | |
| body = request.get_json() | |
| email = body["email"] | |
| receives_emails = body["receivesEmails"] |
NewerOlder