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

Function getShortLinkProps

packages/shared/src/hooks/utils/useGetShortUrl.ts:30–41  ·  view source on GitHub ↗
(
  url: string,
  cid?: ReferralCampaignKey,
  user?: LoggedUser,
)

Source from the content-addressed store, hash-verified

28}
29
30export const getShortLinkProps = (
31 url: string,
32 cid?: ReferralCampaignKey,
33 user?: LoggedUser,
34): { trackedUrl: string; queryKey: QueryKey } => {
35 const trackedUrl = cid
36 ? addLogQueryParams({ link: url, userId: user?.id, cid })
37 : url;
38 const queryKey = generateQueryKey(RequestKey.ShortUrl, user, trackedUrl);
39
40 return { trackedUrl, queryKey };
41};
42
43export const useGetShortUrl = ({
44 query,

Callers 2

SocialIconButtonFunction · 0.90
useGetShortUrlFunction · 0.85

Calls 2

addLogQueryParamsFunction · 0.90
generateQueryKeyFunction · 0.90

Tested by

no test coverage detected