Skip to content

Commit

Permalink
Merge pull request #567 from Jlu18/dev
Browse files Browse the repository at this point in the history
Add check to the asyncCollections to not process the data if api returns with 204
  • Loading branch information
Bryan Montalvan authored Apr 27, 2022
2 parents 83372f9 + b13f654 commit 5f53ed6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/actions/collectionActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ export function asyncCollections(uid) {
if (uid) {
let userCollections = [];
fetch(collectRef, {headers: {"x-access-token": uid}}).then((data) => {
if(data.status === 204){
return;
}
data.json().then((data) => {
data.forEach((doc) => {
userCollections.push(doc);
Expand Down

0 comments on commit 5f53ed6

Please sign in to comment.