MCPcopy Create free account
hub / github.com/dailydotdev/apps / recordPatchyActivity

Function recordPatchyActivity

packages/shared/src/features/patchy/patchyDay.ts:86–94  ·  view source on GitHub ↗
(
  userId: string,
  activity: PatchyActivity,
  now = new Date(),
)

Source from the content-addressed store, hash-verified

84 parsePatchyDay(storageWrapper.getItem(storageKey(userId)), now);
85
86export const recordPatchyActivity = (
87 userId: string,
88 activity: PatchyActivity,
89 now = new Date(),
90): PatchyDay => {
91 const next = addPatchyActivity(readPatchyDay(userId, now), activity, now);
92 storageWrapper.setItem(storageKey(userId), JSON.stringify(next));
93 return next;
94};

Callers 2

patchyDay.spec.tsFile · 0.90
usePatchyCompanionFunction · 0.90

Calls 3

addPatchyActivityFunction · 0.85
readPatchyDayFunction · 0.85
storageKeyFunction · 0.70

Tested by

no test coverage detected