From 7c7fc23a6f5d1a2ca6071e46817029a1179a0743 Mon Sep 17 00:00:00 2001 From: Josh de Leeuw Date: Tue, 12 Mar 2024 09:31:17 -0400 Subject: [PATCH] implement region selection --- pages/admin/new.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pages/admin/new.js b/pages/admin/new.js index 4df1dbe..f5b8544 100644 --- a/pages/admin/new.js +++ b/pages/admin/new.js @@ -79,9 +79,11 @@ function NewExperimentForm() { Storage Location - option': {background: 'black', color: 'white'}}}> + + + + Choose the region where the data will be stored. @@ -133,6 +135,7 @@ async function handleCreateExperiment( const user = auth.currentUser; const title = document.querySelector("#title").value; let osfRepo = document.querySelector("#osf-repo").value; + const region = document.querySelector("#osf-component-region").value; const osfComponentName = document.querySelector("#osf-component-name").value; const nConditions = 1; const useValidation = true; @@ -173,7 +176,7 @@ async function handleCreateExperiment( } const osfResult = await fetch( - `https://api.osf.io/v2/nodes/${osfRepo}/children/`, + `https://api.osf.io/v2/nodes/${osfRepo}/children/?region=${region}`, { method: "POST", headers: {