MCPcopy Index your code
hub / github.com/chavyleung/scripts / apiSave

Function apiSave

chavy.box.js:712–736  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

710}
711
712async function apiSave() {
713 const data = $.toObj($request.body)
714 if (Array.isArray(data)) {
715 data.forEach((dat) => {
716 if (dat.val === null) {
717 dealKey(dat.key)
718 } else {
719 $.setdata(dat.val, dat.key)
720 }
721 })
722 } else {
723 if (data.val === null) {
724 dealKey(data.key)
725 } else {
726 $.setdata(data.val, data.key)
727 }
728 }
729
730 const appId = $.queries['appid']
731 if (appId) {
732 updateCurSesssions(appId, data)
733 }
734
735 $.json = getBoxData()
736}
737
738async function apiUpdate() {
739 const data = $.toObj($request.body)

Callers

nothing calls this directly

Calls 5

dealKeyFunction · 0.70
updateCurSesssionsFunction · 0.70
getBoxDataFunction · 0.70
toObjMethod · 0.45
setdataMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…