mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
Website: Fix object mutation in receive-usage-analytics webhook. (#15185)
Closes: #15182 Changes: - Updated the receive-usage-analytics webhook to create new database records with a cloned `inputs` object. This prevents the JSON attributes from being mutated into strings.
This commit is contained in:
parent
8ae88cfe1a
commit
9984bc6894
@ -39,8 +39,8 @@ module.exports = {
|
||||
|
||||
fn: async function (inputs) {
|
||||
|
||||
// Create a database record for these usage statistics
|
||||
await HistoricalUsageSnapshot.create(inputs);
|
||||
// Create a database record for these usage statistics.
|
||||
await HistoricalUsageSnapshot.create(Object.assign({}, inputs));
|
||||
|
||||
if(!sails.config.custom.datadogApiKey) {
|
||||
throw new Error('No Datadog API key configured! (Please set sails.config.custom.datadogApiKey)');
|
||||
|
Loading…
Reference in New Issue
Block a user