@defra/wls-eps-api
Version:
The API to support the wildlife licencing of European Protected Species
16 lines (14 loc) • 460 B
JavaScript
import { cache } from '../../services/cache.js'
/**
* Clear all effected caches on write
* @param userId
* @param applicationId
* @returns {Promise<void>}
*/
export const clearCaches = async (userId, applicationId) => {
await cache.delete(`/user/${userId}/applications`)
if (applicationId) {
await cache.delete(`/user/${userId}/application/${applicationId}`)
await cache.delete(`/user/${userId}/application/${applicationId}/applicant`)
}
}