src/components/views/PlayWhites.js
// check if user has played back card if not, black card needs to be played first
check if user has played back card if not, black card needs to be played first
check if user has played back card if not black card needs to be played first
async function ownBlackCardPlayed() {
          await api.get(`/users/${userId}/games/blackCards/current`)
            .then(() => {setBlackCardPlayed(true);})
            .catch(error => {
              if (error.response.status === 404) { setBlackCardPlayed(false); }
              else { console.error("Details: ", error); alert("Invalid Input:\n " + handleError(error)); }});
        }
async function ownBlackCardPlayed ( ) { await api . get ( ` ${ userId } ` ) . then ( ( ) => { setBlackCardPlayed ( true ) ; } ) . catch ( error => { if ( error . response . status === 404 ) { setBlackCardPlayed ( false ) ; } else { console . error ( "Details: " , error ) ; alert ( "Invalid Input:\n " + handleError ( error ) ) ; } } ) ; }
check if user has played back card if not, black card needs to be played first
check if user has played back card if not black card needs to be played first