Skip to content

Commit

Permalink
Merge pull request #8 from pepfar-datim/DAT_3177_clear_cache
Browse files Browse the repository at this point in the history
Dat 3177 clear cache
  • Loading branch information
maggiedemeke authored Sep 21, 2023
2 parents 60ea0bd + 88dcb85 commit 39ba8d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/modules/main/services/setupNamespace.service.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {getJson, postJson} from "@pepfar-react-lib/datim-api";
import {getJson, postJson } from "@pepfar-react-lib/datim-api";
import {getKeyUid, shareKey} from "../../shared/services/shareKey.service";

const config = require('../../../config/config.json');
Expand Down
3 changes: 2 additions & 1 deletion src/modules/shared/services/content.service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import sanitize from '../../shared/services/sanitize.service';
import getContentUrl, {getWidgetId} from './contentUrl.service';
import {getKeyUid, shareKey} from "./shareKey.service";
import YAML from 'yaml'
import {getJson, postJson, putJson} from "@pepfar-react-lib/datim-api";
import {getJson, postJson, putJson,postEmpty} from "@pepfar-react-lib/datim-api";

export enum ContentItemType{
string='string',
Expand Down Expand Up @@ -81,6 +81,7 @@ export function fetchContent():Promise<string>{
export function saveContent(content) {
return putJson(getContentUrl(), { body: content }).catch(async () => {
await postJson(getContentUrl(), { body: content });
await postEmpty('/maintenance/cache');
let widgetId = getWidgetId();
let widgetUid = await getKeyUid(widgetId);
return shareKey(widgetUid, 'r-------');
Expand Down

0 comments on commit 39ba8d0

Please # to comment.