crobertsbmw/deckofcards

Sever error 500 when listing piles

rjquiban opened this issue · 4 comments

When I make a request to list a pile, I get the error, "Unexpected token at < in JSON at position 0" as shown below:
Screen Shot 2020-08-27 at 11 07 57 PM

However, when I visit the HTTP request link in my browser and POSTMAN, the response seems to work as expected:
Screen Shot 2020-08-27 at 11 08 46 PM

I'm obtaining and storing the data the same way as my previous API calls that work, so I'm not sure if this is an error on my end or not. Thanks in advance!

Screen Shot 2020-08-28 at 11 57 22 AM

This is my code, and I make sure to call it after I have already created a pile.

Line 95 is the console.log(error) catch case. I'll keep exploring my code to try and find a solution. Thanks anyways for your help!