MCPcopy Create free account
hub / github.com/chavyleung/scripts / apiSave

Function apiSave

box/chavy.boxjs.js:713–737  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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