feat: start with functionality
ref: N25B-400
This commit is contained in:
19
src/pages/MonitoringPage/MonitoringPageAPI.ts
Normal file
19
src/pages/MonitoringPage/MonitoringPageAPI.ts
Normal 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");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user