Skip to content

Commit 2f2ceb2

Browse files
committed
Slette cache for malBestilling naar dette skjer ved ordinaer bestilling
1 parent 1333bec commit 2f2ceb2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

apps/dolly-backend/src/main/java/no/nav/dolly/service/MalBestillingService.java

+5
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import no.nav.testnav.libs.servletsecurity.action.GetUserInfo;
1818
import org.apache.commons.collections4.IterableUtils;
1919
import org.apache.commons.lang3.StringUtils;
20+
import org.springframework.cache.CacheManager;
2021
import org.springframework.http.HttpStatus;
2122
import org.springframework.stereotype.Service;
2223
import org.springframework.transaction.annotation.Transactional;
@@ -33,6 +34,7 @@
3334

3435
import static java.util.Objects.isNull;
3536
import static java.util.Objects.nonNull;
37+
import static no.nav.dolly.config.CachingConfig.CACHE_BESTILLING_MAL;
3638
import static no.nav.dolly.util.CurrentAuthentication.getUserId;
3739

3840
@Service
@@ -49,6 +51,7 @@ public class MalBestillingService {
4951
private final MapperFacade mapperFacade;
5052
private final GetUserInfo getUserInfo;
5153
private final ObjectMapper objectMapper;
54+
private final CacheManager cacheManager;
5255

5356
@Transactional(readOnly = true)
5457
public RsMalBestillingWrapper getMalBestillinger() {
@@ -138,6 +141,8 @@ public void saveBestillingMal(Bestilling bestilling, String malNavn, Bruker bruk
138141
oppdateEksisterende.setBestKriterier(bestilling.getBestKriterier());
139142
oppdateEksisterende.setMiljoer(bestilling.getMiljoer());
140143
}
144+
145+
cacheManager.getCache(CACHE_BESTILLING_MAL).clear();
141146
}
142147

143148
@Transactional

0 commit comments

Comments
 (0)