diff options
| author | Georgios Andreadis <info@gandreadis.com> | 2020-07-07 09:55:10 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-08-24 19:47:25 +0200 |
| commit | b4bdf9fde013bb7ff9579693b64ff575f7b00e44 (patch) | |
| tree | 5e05ceba918849391a639bbeeab37d290a86523c /frontend/src/api/routes/projects.js | |
| parent | 7331e9baf2cfe7bdfb24effcf0a4801da1e7ea4d (diff) | |
Rename simulations to projects and remove experiment view
Diffstat (limited to 'frontend/src/api/routes/projects.js')
| -rw-r--r-- | frontend/src/api/routes/projects.js | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/frontend/src/api/routes/projects.js b/frontend/src/api/routes/projects.js new file mode 100644 index 00000000..a261adb8 --- /dev/null +++ b/frontend/src/api/routes/projects.js @@ -0,0 +1,56 @@ +import { sendRequest } from '../index' +import { deleteById, getById } from './util' + +export function getProject(projectId) { + return getById('/projects/{projectId}', { projectId }) +} + +export function addProject(project) { + return sendRequest({ + path: '/projects', + method: 'POST', + parameters: { + body: { + project, + }, + path: {}, + query: {}, + }, + }) +} + +export function updateProject(project) { + return sendRequest({ + path: '/projects/{projectId}', + method: 'PUT', + parameters: { + body: { + project, + }, + path: { + projectId: project._id, + }, + query: {}, + }, + }) +} + +export function deleteProject(projectId) { + return deleteById('/projects/{projectId}', { projectId }) +} + +export function addExperiment(projectId, experiment) { + return sendRequest({ + path: '/projects/{projectId}/experiments', + method: 'POST', + parameters: { + body: { + experiment, + }, + path: { + projectId, + }, + query: {}, + }, + }) +} |
