Skip to content

Commit

Permalink
Rydde vekk ting relatert til søkt gradering
Browse files Browse the repository at this point in the history
  • Loading branch information
jolarsen committed May 21, 2024
1 parent 555c38d commit bc7d633
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,6 @@ and not exists (
entityManager.flush();
}

public void fjernSøktGradering() {
entityManager.createNativeQuery("DELETE FROM OPPGAVE_EVENT_LOGG where ANDRE_KRITERIER_TYPE = 'SOKT_GRADERING'").executeUpdate();;
entityManager.createNativeQuery("DELETE FROM OPPGAVE_EGENSKAP where ANDRE_KRITERIER_TYPE = 'SOKT_GRADERING'").executeUpdate();;
entityManager.createNativeQuery("DELETE FROM FILTRERING_ANDRE_KRITERIER where ANDRE_KRITERIER_TYPE = 'SOKT_GRADERING'").executeUpdate();;
entityManager.flush();
}


public Optional<Avdeling> hentAvdelingFraEnhet(String avdelingEnhet) {
var query = entityManager.createQuery("FROM avdeling a WHERE a.avdelingEnhet = :avdelingEnhet", Avdeling.class)
.setParameter("avdelingEnhet", avdelingEnhet);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,26 +109,4 @@ public Response slettSaksbehandlereUtenKnytninger() {
return Response.ok().build();
}

@POST
@Path("/slett-mer-enhetsdata")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Sletter oppgaver, reservasjoner mm som har referanse til enhet", tags = "admin")
@BeskyttetRessurs(actionType = ActionType.CREATE, resourceType = ResourceType.DRIFT)
public Response slettResterendeEnhetsdata(@NotNull @Valid DriftAvdelingEnhetDto avdelingEnhetDto) {
organisasjonRepository.slettØvrigeEnhetsdata(avdelingEnhetDto.avdelingEnhet());
return Response.ok().build();
}

@POST
@Path("/slett-gradering")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Sletter søkt gradering", tags = "admin")
@BeskyttetRessurs(actionType = ActionType.CREATE, resourceType = ResourceType.DRIFT)
public Response slettSøktGradering() {
organisasjonRepository.fjernSøktGradering();
return Response.ok().build();
}

}

0 comments on commit bc7d633

Please sign in to comment.