Skip to content

Commit

Permalink
default contact should be a User object, not a string
Browse files Browse the repository at this point in the history
  • Loading branch information
ledwards committed Jun 10, 2020
1 parent ed58992 commit a6eac63
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/functions.js
Expand Up @@ -29,6 +29,10 @@ const response = [
];
const thanks = new RegExp("thank(s| you) rooty", "i");

const defaultContact = [{
"email": "kane@root.vc"
}];

//replaceAll function for strings
function replaceAll(str, find, replace) {
return str.replace(new RegExp(find, 'g'), replace);
Expand Down Expand Up @@ -137,7 +141,7 @@ function getStringFromMsg(msg){

//enters a Deal record into airtable
//returns a Promise containing the record
function putDeal(companyUID = "", contact = "kane@root.vc", status = "Lead"){
function putDeal(companyUID = "", contact = defaultContact, status = "Lead"){
return base('Deal Pipeline').create({
"Status": status,
"Company": [
Expand All @@ -149,7 +153,7 @@ function putDeal(companyUID = "", contact = "kane@root.vc", status = "Lead"){

//updates a Deal record into airtable
//returns a Promise containing the record
function updateDeal(dealRecord = "", companyUID = "", contact = "kane@root.vc",
function updateDeal(dealRecord = "", companyUID = "", contact = defaultContact,
notes = "", source = "", pitchdeck = "", status = "Lead"){
return base('Deal Pipeline').replace(dealRecord, {
"Status": "Lead",
Expand Down

0 comments on commit a6eac63

Please sign in to comment.