Skip to content

Commit

Permalink
Added missing status import to database import script
Browse files Browse the repository at this point in the history
  • Loading branch information
pstrassmann committed Aug 13, 2020
1 parent 95204b9 commit 4713a36
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"start": "node server.js",
"server": "nodemon server.js",
"msandbox": "node scripts/mongooseSandbox.js",
"process": "node scripts/populateDataFromVetting.js",
"process": "node scripts/populateDataFromTapMaster.js",
"client": "npm run start --prefix client",
"dev": "concurrently \"npm run server\" \"npm run client\""
},
Expand Down
17 changes: 16 additions & 1 deletion scripts/populateDataFromTapMaster.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,20 @@ tapMaster.forEach(async (entry) => {
currentDog.vettingStatus = [...currentDog.vettingStatus, 'incomplete'];
}
break;
case 'In Foster - Vetting Complete':
if (
currentDog.status.length === 0 ||
!currentDog.status.includes('fostered')
) {
currentDog.status = [...currentDog.status, 'fostered'];
}
if (
currentDog.vettingStatus.length === 0 ||
!currentDog.vettingStatus.includes('complete')
) {
currentDog.vettingStatus = [...currentDog.vettingStatus, 'complete'];
}
break;
case 'Adopted - Pending Records':
if (
!currentDog.status.length === 0 ||
Expand Down Expand Up @@ -403,7 +417,8 @@ tapMaster.forEach(async (entry) => {
}

//SAVE OR LOG
// await currentDog.save();
// if (currentDog.name === 'Poi') console.log(currentDog);
await currentDog.save();

} catch (e) {
console.error(e);
Expand Down

0 comments on commit 4713a36

Please sign in to comment.