feat: start with functionality

ref: N25B-400
This commit is contained in:
Björn Otgaar
2026-01-07 11:54:29 +01:00
parent 0fefefe7f0
commit 794e638081
2 changed files with 42 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
const API_BASE = "http://localhost:8000/"; // Change depending on Pims interup agent/ correct endpoint
/**
* Sends an API call to the CB for going to the next phase.
* In case we can't go to the next phase, the function will throw an error.
*/
export async function nextPhase(): Promise<void> {
const res = await fetch(`${API_BASE}/experiment/next`, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
});
if (!res.ok) {
throw new Error("Failed to advance to next phase");
}
}