Package ai.chatur.cortex.spring.branch
Class BranchEditController
java.lang.Object
ai.chatur.cortex.spring.branch.BranchEditController
JSON API consumed by
branch.js to apply reviewer edits to a branch pending review, in
place, without a page reload.-
Constructor Summary
ConstructorsConstructorDescriptionBranchEditController(ai.chatur.cortex.CortexBranches branches) Creates the controller. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Void> renameBranchSubjects(String branch, List<ai.chatur.cortex.BranchRename> renames) Renames subjects staged on a branch.org.springframework.http.ResponseEntity<Void> updateBranch(String branch, List<ai.chatur.cortex.BranchChange> changes) Applies deletions and object edits to the assertions staged on a branch.
-
Constructor Details
-
BranchEditController
public BranchEditController(ai.chatur.cortex.CortexBranches branches) Creates the controller.- Parameters:
branches- the branches role used to apply edits to a pending branch
-
-
Method Details
-
updateBranch
@PostMapping("/branches/{branch}/update") public org.springframework.http.ResponseEntity<Void> updateBranch(@PathVariable("branch") String branch, @RequestBody List<ai.chatur.cortex.BranchChange> changes) Applies deletions and object edits to the assertions staged on a branch.- Parameters:
branch- the branch namechanges- the changes to apply, as JSON- Returns:
- 204 No Content if the branch existed and the changes were applied, 404 Not Found if the branch does not exist
-
renameBranchSubjects
@PostMapping("/branches/{branch}/rename") public org.springframework.http.ResponseEntity<Void> renameBranchSubjects(@PathVariable("branch") String branch, @RequestBody List<ai.chatur.cortex.BranchRename> renames) Renames subjects staged on a branch.- Parameters:
branch- the branch namerenames- the renames to apply, as JSON- Returns:
- 204 No Content if the branch existed and the renames were applied, 404 Not Found if the branch does not exist
-