ExerciseDB

FREEMIUM
Par Justin Mozley | Mise à jour 7 days ago | Health and Fitness
Popularité

9.8 / 10

Latence

561ms

Niveau de service

100%

Health Check

100%

Retour à toutes les discussions

gifUrl issues

Rapid account: Amenitombarii
amenitombarii
4 months ago

import React from ‘react’;
import { Link } from ‘react-router-dom’;
import { Button, Stack, Typography } from ‘@mui/material’;

const ExerciseCard = ({ exercise }) => (
<Link className=“exercise-card” to={/exercise/${exercise.id}}>
<img src={exercise.gifUrl} alt={exercise.name} loading=“lazy” />
<Stack direction=“row”>
<Button sx={{ ml: ‘21px’, color: ‘#fff’, background: ‘#FFA9A9’, fontSize: ‘14px’, borderRadius: ‘20px’, textTransform: ‘capitalize’ }}>
{exercise.bodyPart}
</Button>
<Button sx={{ ml: ‘21px’, color: ‘#fff’, background: ‘#FCC757’, fontSize: ‘14px’, borderRadius: ‘20px’, textTransform: ‘capitalize’ }}>
{exercise.target}
</Button>
</Stack>
<Typography ml=“21px” color="#000" fontWeight=“bold” sx={{ fontSize: { lg: ‘24px’, xs: ‘20px’ } }} mt=“11px” pb=“10px” textTransform=“capitalize”>
{exercise.name}
</Typography>
</Link>
);

export default ExerciseCard;

this is the code yet the gif url isn’t working and the images aren’t appearning what can l do ?

Rapid account: Justin W Fns XH T 6
justin-WFnsXH_t6 Commented 4 months ago


Here is an image directly from the gifUrl that I fetched from the api dashboard. The gifUrl is working correctly so perhaps something is occurring in your code to prevent the image from appearing correctly.

Rapid account: Justin W Fns XH T 6
justin-WFnsXH_t6 Commented 4 months ago

Have you tested the endpoint in postman or the RapidAPI api dashboard? Have you logged the gifUrl then pasted it in the browser to make sure the gif is coming through?

Rapid account: Amenitombarii
amenitombarii Commented 4 months ago

l didn’t recieve any error msg l just didn’t get the gif in the first place

Rapid account: Justin W Fns XH T 6
justin-WFnsXH_t6 Commented 4 months ago

Please read the below paragraph which is displayed in the About section of the api:

A note on image url’s:

The property gifUrl on each exercise will change once per day. As a result you may receive an error response if the gifUrl has expired. This is expected behavior as the url’s are set to expire and refresh in the system at exactly 12:00pm US Central Time. Please make accomidations for this in your code to prevent your users from experiencing any exercise image outages.

Participez à la discussion - ajoutez un commentaire ci-dessous:

Connectez-vous / Inscrivez-vous pour publier de nouveaux commentaires