Skip to content

Commit

Permalink
[DAT-3177] sends empty post
Browse files Browse the repository at this point in the history
  • Loading branch information
Maereg Sorri committed Sep 21, 2023
1 parent 12c2f76 commit bc5b1a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/modules/main/services/setupNamespace.service.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {getJson, postJson} from "@pepfar-react-lib/datim-api";
import {getJson, postJson,postEmpty } from "@pepfar-react-lib/datim-api";
import {getKeyUid, shareKey} from "../../shared/services/shareKey.service";

const config = require('../../../config/config.json');

async function addNamespaceConfig(datastoreNamespace, onlyOpenToSuperUsersKey) {
const data = { [onlyOpenToSuperUsersKey]: false };
await postJson(`/dataStore/${datastoreNamespace}/configuration`, data);
await postJson(`/maintenance/cache`, '');
await postEmpty('/maintenance/cache');
const configKeyUid = await getKeyUid('configuration');
await shareKey(configKeyUid, 'r-------');
}
Expand Down
4 changes: 2 additions & 2 deletions 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,7 +81,7 @@ export function fetchContent():Promise<string>{
export function saveContent(content) {
return putJson(getContentUrl(), { body: content }).catch(async () => {
await postJson(getContentUrl(), { body: content });
await postJson(`/maintenance/cache`, '');
await postEmpty('/maintenance/cache');
let widgetId = getWidgetId();
let widgetUid = await getKeyUid(widgetId);
return shareKey(widgetUid, 'r-------');
Expand Down

0 comments on commit bc5b1a0

Please # to comment.