Closed alexander-novo closed 3 years ago
You can do this by calling the projectService.saveProject()
function. There's no checking for things that are allowed to be modified as of yet (the server just takes whatever it is given to it and attempts to save it in the database), but I'm more focused on functionality right now, and I'll come back and do it correctly later. Therefore I'm leaving the issue open.
I think this is as far as this is going to get - any other changes wouldn't be additional functionality, just how it "should" be done (to protect against attacks and be efficient in data transfer), so they probably won't be implemented.
When a project is changed in the toolkit, it should be saved back to the database through a new api:
PUT /api/projects/project?id=...
- Accepts some representation of the project or the changes which have been made to the project and stores them in the database.I think it would be easiest to just upload the entire project object each time, but it would be best to only have to upload the changes. I think there are libraries specifically for doing this kind of thing - readying objects to get stored in databases from REST APIs. Maybe look into that. We would want to make certain that certain things aren't editable - such as database IDs, ownership information, URLs, numbers of items which are managed through other interfaces (such as assets), etc.