Skip to content

Commit

Permalink
#8600 remove orphan template api
Browse files Browse the repository at this point in the history
  • Loading branch information
sekmiller committed May 17, 2022
1 parent aee6b7b commit 6909bf3
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/main/java/edu/harvard/iq/dataverse/api/Admin.java
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,6 @@ public Response deleteTemplate(@PathParam("id") long id) {
return ok("Template " + doomed.getName() + " deleted.");
}

@Path("orphanTemplates")
@GET
public Response findOrphanTemplates() {

return findTemplates("9999");
}

@Path("templates")
@GET
Expand All @@ -263,15 +257,13 @@ public Response findAllTemplates() {
public Response findTemplates(@PathParam("alias") String alias) {
List<Template> templates;
try {
if (alias.equals("9999")) {
templates = templateService.findOrphan();
} else if (alias.isEmpty()) {
if (alias.isEmpty()) {
templates = templateService.findAll();
} else {
Dataverse owner = findDataverseOrDie(alias);
templates = templateService.findByOwnerId(owner.getId());
}

JsonArrayBuilder container = Json.createArrayBuilder();
for (Template t : templates) {
JsonObjectBuilder bld = Json.createObjectBuilder();
Expand Down

0 comments on commit 6909bf3

Please sign in to comment.