* insert_org saves an org's data to the orgs table. *
(data, callback)
| 88 | * |
| 89 | */ |
| 90 | function insert_org (data, callback) { |
| 91 | connect( function insert_org_after_connected () { |
| 92 | const { url,name,description,location,website,email,pcount,uid } = data; |
| 93 | const query = `INSERT INTO orgs |
| 94 | (url, name, description, location, website, email, pcount, uid) |
| 95 | VALUES ($1, $2, $3, $4, $5, $6, $7, $8)`; |
| 96 | const values = [url,name,description,location,website,email,pcount,uid]; |
| 97 | |
| 98 | PG_CLIENT.query(query, values, function(error, result) { |
| 99 | utils.log_error(error, data, new Error().stack); |
| 100 | return insert_next_page (data, callback); |
| 101 | }); |
| 102 | }); |
| 103 | } |
| 104 | |
| 105 | /** |
| 106 | * select_org retrieves the org for a given url. |
nothing calls this directly
no test coverage detected