Skip to content

Commit

Permalink
Add airCreate
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwofford committed Sep 18, 2019
1 parent a438af4 commit 3bb7b2c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ export const airPatch = (baseName, recordID, values) =>
})
})

export const airCreate = (baseName, fields) =>
new Promis((resolve, reject) => {
base(baseName).create([{ fields }], (err, records) => {
if (err) {
console.error(err)
reject(err)
}
resolve(records[0])
})
})

export const airFind = (baseName, fieldName, value) =>
new Promise((resolve, reject) => {
// see airGet() for usage
Expand Down

0 comments on commit 3bb7b2c

Please sign in to comment.