MCPcopy Create free account
hub / github.com/cppla/ServerStatus / saveConfigItem

Function saveConfigItem

web/js/app.js:783–794  ·  view source on GitHub ↗
(key, index, item)

Source from the content-addressed store, hash-verified

781 return `/api/${key}/${encodeURIComponent(id || String(index))}`;
782}
783async function saveConfigItem(key, index, item){
784 S.admin.saving = true;
785 S.suppressStatsReloadUntil = Date.now() + 8000;
786 try{
787 const data = await api(configItemPath(key, index), { method: index >= 0 ? 'PUT' : 'POST', body: JSON.stringify(item) });
788 if(data.config) S.admin.config = normalizeAdminConfig(data.config);
789 S.suppressStatsReloadUntil = Date.now() + 8000;
790 return data;
791 }finally{
792 S.admin.saving = false;
793 }
794}
795async function deleteConfigItem(key, index){
796 S.admin.saving = true;
797 S.suppressStatsReloadUntil = Date.now() + 8000;

Callers 1

bindAdminFunction · 0.85

Calls 3

apiFunction · 0.85
configItemPathFunction · 0.85
normalizeAdminConfigFunction · 0.85

Tested by

no test coverage detected