MCPcopy Create free account
hub / github.com/apitable/apitable / set

Method set

packages/widget-sdk/src/model/cloud_storage.ts:109–122  ·  view source on GitHub ↗

* Set the value to the key passed in. * * If the key setting fails, an error will be thrown. * * @param key A string type key. * @param value plain object / number / boolean / string / array / null JSON type data, if not passed, it means delete this. * #### Example * ```js *

(key: string, value?: ICloudStorageValue)

Source from the content-addressed store, hash-verified

107 * ```
108 */
109 set(key: string, value?: ICloudStorageValue): void {
110 cmdExecute({
111 cmd: CollaCommandName.SetGlobalStorage,
112 key,
113 value,
114 resourceType: ResourceType.Widget,
115 resourceId: this.widgetId,
116 }, this.widgetId).then(result => {
117 if (result.result !== ExecuteResult.Success) {
118 // TODO: replace with toast
119 alert('Operation execution failed');
120 }
121 });
122 }
123}

Callers

nothing calls this directly

Calls 1

cmdExecuteFunction · 0.90

Tested by

no test coverage detected