Skip to content

Commit cfc6e77

Browse files
committed
clear cache when updating tech/stacks
1 parent 2e9a113 commit cfc6e77

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

TechStacks.Client/src/components/forms/TechStackForm.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ export function TechStackForm({ slug, onDone }: TechStackFormProps) {
149149
}
150150

151151
if (api.succeeded) {
152+
gateway.clearTechStacksCache();
152153
if (onDone) {
153154
onDone();
154155
} else {

TechStacks.Client/src/components/forms/TechnologyForm.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ export function TechnologyForm({ slug, onDone }: TechnologyFormProps) {
115115
}
116116

117117
if (api.succeeded) {
118+
gateway.clearTechnologiesCache();
118119
if (onDone) {
119120
onDone();
120121
} else {

TechStacks.Client/src/lib/api/gateway.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ let allTechnologiesCache: dtos.GetAllTechnologiesResponse | null = null;
113113
let technologyTiersCache: any[] | null = null;
114114
const technologyCache = new Map<string, any>();
115115

116-
function clearTechnologiesCache() {
116+
export function clearTechnologiesCache() {
117117
allTechnologiesCache = null;
118118
technologyTiersCache = null;
119119
technologyCache.clear();
@@ -197,7 +197,7 @@ export const deleteTechnology = async (id: number) => {
197197
let allTechStacksCache: dtos.GetAllTechnologyStacksResponse | null = null;
198198
const techStackCache = new Map<string, dtos.GetTechnologyStackResponse>();
199199

200-
function clearTechStacksCache() {
200+
export function clearTechStacksCache() {
201201
allTechStacksCache = null;
202202
techStackCache.clear();
203203
}

0 commit comments

Comments
 (0)