MCPcopy
hub / github.com/louislam/dockge / set

Method set

backend/settings.ts:80–94  ·  view source on GitHub ↗

* Sets the specified setting to specified value * @param key Key of setting to set * @param value Value to set to * @param {?string} type Type of setting * @returns {Promise }

(key : string, value : object | string | number | boolean, type : string | null = null)

Source from the content-addressed store, hash-verified

78 * @returns {Promise<void>}
79 */
80 static async set(key : string, value : object | string | number | boolean, type : string | null = null) {
81
82 let bean = await R.findOne("setting", " `key` = ? ", [
83 key,
84 ]);
85 if (!bean) {
86 bean = R.dispense("setting");
87 bean.key = key;
88 }
89 bean.type = type;
90 bean.value = JSON.stringify(value);
91 await R.store(bean);
92
93 Settings.deleteCache([ key ]);
94 }
95
96 /**
97 * Get settings based on type

Callers 7

bindTerminalFunction · 0.80
constructorMethod · 0.80
getStackListMethod · 0.80
getStatusListMethod · 0.80
getServiceStatusListMethod · 0.80
sendStackListMethod · 0.80
onMethod · 0.80

Calls 1

deleteCacheMethod · 0.80

Tested by

no test coverage detected