@toxplanet/pegasus-sdk 1.1.21 → 1.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/chemicals.js +8 -8
- package/package.json +1 -1
package/lib/chemicals.js
CHANGED
|
@@ -139,8 +139,8 @@ class ChemicalsService {
|
|
|
139
139
|
{ name: 'chemical_identifiers', value: { stringValue: JSON.stringify(chemical.chemicalIdentifiers ?? {}) }, typeHint: 'JSON' },
|
|
140
140
|
{ name: 'chemical_synonyms', value: { stringValue: this._toPostgresArray(chemical.chemicalSynonyms ?? []) } },
|
|
141
141
|
{ name: 'chemical_categories', value: { stringValue: this._toPostgresArray(chemical.chemicalCategories ?? []) } },
|
|
142
|
-
{ name: 'created_at', value: { stringValue: this._serializeDate(chemical.createdAt) }
|
|
143
|
-
{ name: 'updated_at', value: { stringValue: this._serializeDate(chemical.updatedAt) }
|
|
142
|
+
{ name: 'created_at', value: { stringValue: this._serializeDate(chemical.createdAt) } },
|
|
143
|
+
{ name: 'updated_at', value: { stringValue: this._serializeDate(chemical.updatedAt) } }
|
|
144
144
|
];
|
|
145
145
|
|
|
146
146
|
return { sql: upsertSql, parameters };
|
|
@@ -335,14 +335,14 @@ class ChemicalsService {
|
|
|
335
335
|
{ name: 'chemical_identifiers', value: { stringValue: JSON.stringify(chemical.chemical_identifiers || {}) }, typeHint: 'JSON' },
|
|
336
336
|
{ name: 'chemical_synonyms', value: { stringValue: this._toPostgresArray(chemical.chemical_synonyms || []) } },
|
|
337
337
|
{ name: 'chemical_categories', value: { stringValue: this._toPostgresArray(chemical.chemical_categories || []) } },
|
|
338
|
-
{ name: 'created_at', value: { stringValue: this._serializeDate(chemical.created_at || new Date()) }
|
|
339
|
-
{ name: 'updated_at', value: { stringValue: this._serializeDate(chemical.updated_at || new Date()) }
|
|
338
|
+
{ name: 'created_at', value: { stringValue: this._serializeDate(chemical.created_at || new Date()) } },
|
|
339
|
+
{ name: 'updated_at', value: { stringValue: this._serializeDate(chemical.updated_at || new Date()) } }
|
|
340
340
|
];
|
|
341
341
|
|
|
342
342
|
if (chemical.imported_at) {
|
|
343
343
|
columns.push('imported_at');
|
|
344
344
|
values.push(':imported_at');
|
|
345
|
-
params.push({ name: 'imported_at', value: { stringValue: this._serializeDate(chemical.imported_at) }
|
|
345
|
+
params.push({ name: 'imported_at', value: { stringValue: this._serializeDate(chemical.imported_at) } });
|
|
346
346
|
}
|
|
347
347
|
|
|
348
348
|
if (chemical.chemical_id) {
|
|
@@ -389,7 +389,7 @@ class ChemicalsService {
|
|
|
389
389
|
}
|
|
390
390
|
|
|
391
391
|
setClauses.push('updated_at = :updated_at');
|
|
392
|
-
params.push({ name: 'updated_at', value: { stringValue: this._serializeDate(new Date()) }
|
|
392
|
+
params.push({ name: 'updated_at', value: { stringValue: this._serializeDate(new Date()) } });
|
|
393
393
|
|
|
394
394
|
params.push({ name: 'id', value: { stringValue: chemicalId } });
|
|
395
395
|
|
|
@@ -454,7 +454,7 @@ class ChemicalsService {
|
|
|
454
454
|
const params = [
|
|
455
455
|
{ name: 'path', value: { stringValue: JSON.stringify(pathArray) }, typeHint: 'JSON' },
|
|
456
456
|
{ name: 'value', value: { stringValue: JSON.stringify(newValue) }, typeHint: 'JSON' },
|
|
457
|
-
{ name: 'updated_at', value: { stringValue: this._serializeDate(new Date()) }
|
|
457
|
+
{ name: 'updated_at', value: { stringValue: this._serializeDate(new Date()) } },
|
|
458
458
|
{ name: 'collection_name', value: { stringValue: collectionName } }
|
|
459
459
|
];
|
|
460
460
|
|
|
@@ -496,7 +496,7 @@ class ChemicalsService {
|
|
|
496
496
|
|
|
497
497
|
params.push({ name: 'path', value: { stringValue: JSON.stringify(pathArray) }, typeHint: 'JSON' });
|
|
498
498
|
params.push({ name: 'value', value: { stringValue: JSON.stringify(newValue) }, typeHint: 'JSON' });
|
|
499
|
-
params.push({ name: 'updated_at', value: { stringValue: this._serializeDate(new Date()) }
|
|
499
|
+
params.push({ name: 'updated_at', value: { stringValue: this._serializeDate(new Date()) } });
|
|
500
500
|
|
|
501
501
|
const result = await this.connection.query(sql, params);
|
|
502
502
|
const updated = result.rows.map(row => this._mapChemicalRow(row));
|
package/package.json
CHANGED