Class BranchEditController

java.lang.Object
ai.chatur.cortex.spring.branch.BranchEditController

@RestController public class BranchEditController extends Object
JSON API consumed by branch.js to apply reviewer edits to a branch pending review, in place, without a page reload.
  • 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 name
      changes - 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 name
      renames - 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