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

Function getShortLinkProps

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

Source from the content-addressed store, hash-verified

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

Callers 2

SocialIconButtonFunction · 0.90
useGetShortUrlFunction · 0.85

Calls 2

addLogQueryParamsFunction · 0.90
generateQueryKeyFunction · 0.90

Tested by

no test coverage detected