Skip to content

Commit

Permalink
implement region selection
Browse files Browse the repository at this point in the history
  • Loading branch information
jodeleeuw committed Mar 12, 2024
1 parent 0d8652a commit 7c7fc23
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pages/admin/new.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ function NewExperimentForm() {
</FormControl>
<FormControl id="osf-component-region">
<FormLabel>Storage Location</FormLabel>
<Select placeholder="Select region">
<option value="us">US</option>
<option value="de-1">EU</option>
<Select defaultValue="us" sx={{'> option': {background: 'black', color: 'white'}}}>
<option value="us">United States</option>
<option value="de-1">Germany - Frankfurt</option>
<option value="au-1">Australia - Sydney</option>
<option value="ca-1">Canada - Montreal</option>
</Select>
<FormHelperText color="gray">
Choose the region where the data will be stored.
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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: {
Expand Down

0 comments on commit 7c7fc23

Please sign in to comment.