MCPcopy Create free account
hub / github.com/error311/FileRise / post

Function post

public/js/adminPanel.js:972–991  ·  view source on GitHub ↗
(action, key, extra = {})

Source from the content-addressed store, hash-verified

970 `;
971
972 const post = async (action, key, extra = {}) => {
973 const res = await fetch(withBase('/api/admin/setEncryptionKey.php'), {
974 method: 'POST',
975 credentials: 'include',
976 headers: {
977 'Content-Type': 'application/json',
978 'X-CSRF-Token': window.csrfToken || ''
979 },
980 body: JSON.stringify({ action, ...(key ? { key } : {}), ...extra })
981 });
982 const text = await res.text();
983 let body = null;
984 try { body = text ? JSON.parse(text) : null; } catch (e) { /* ignore */ }
985 return {
986 ok: res.ok,
987 status: res.status,
988 body: body || {},
989 raw: text || ''
990 };
991 };
992
993 const refresh = async () => {
994 const r = await fetch(withBase('/api/admin/getConfig.php?ts=' + Date.now()), {

Callers 1

Calls 1

withBaseFunction · 0.85

Tested by

no test coverage detected