From 09f3249c8081e3bffc815b216f6f001b294b2ec6 Mon Sep 17 00:00:00 2001 From: Peter Hedenskog Date: Sun, 2 Jun 2024 17:59:11 +0200 Subject: [PATCH] Use default configuration also for API calls (#9) --- server/src/util/add-test.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/server/src/util/add-test.js b/server/src/util/add-test.js index 3f3be84..7cc5d86 100644 --- a/server/src/util/add-test.js +++ b/server/src/util/add-test.js @@ -154,7 +154,7 @@ export async function addTest(request) { } export async function addTestFromAPI( - config, + userConfig, location, url, scripting, @@ -164,8 +164,12 @@ export async function addTestFromAPI( priority ) { const deviceId = - get(config, 'browsertime.firefox.android.deviceSerial') || - get(config, 'browsertime.chrome.android.deviceSerial'); + get(userConfig, 'browsertime.firefox.android.deviceSerial') || + get(userConfig, 'browsertime.chrome.android.deviceSerial'); + + const defaultConfig = await getDefaultSitespeedConfiguration(); + let config = {}; + merge(config, defaultConfig, userConfig); const slug = get(config, 'slug', ''); let queue = getQueueName(location, deviceId);