MCPcopy
hub / github.com/chartbrew/chartbrew / update

Function update

server/controllers/DataRequestCacheController.js:40–54  ·  view source on GitHub ↗
(data, drId)

Source from the content-addressed store, hash-verified

38};
39
40const update = async (data, drId) => {
41 try {
42 const cacheValue = {
43 ...data,
44 dr_id: drId,
45 createdAt: data?.createdAt || new Date().toISOString(),
46 updatedAt: new Date().toISOString(),
47 };
48
49 await runtimeCache.store.set(cacheKey(drId), JSON.stringify(cacheValue));
50 return findLast(drId);
51 } catch (error) {
52 return Promise.reject(error);
53 }
54};
55
56const create = async (drId, data) => {
57 return update(data, drId);

Callers 1

createFunction · 0.70

Calls 3

cacheKeyFunction · 0.85
findLastFunction · 0.85
setMethod · 0.45

Tested by

no test coverage detected