MCPcopy
hub / github.com/linkwarden/linkwarden / useConfig

Function useConfig

packages/router/config.tsx:51–70  ·  view source on GitHub ↗
(auth?: MobileAuth)

Source from the content-addressed store, hash-verified

49};
50
51const useConfig = (auth?: MobileAuth) => {
52 return useQuery({
53 queryKey: ["config", auth?.instance ?? "web"],
54 queryFn: async () => {
55 const response = await fetch(
56 (auth?.instance ? auth.instance : "") + "/api/v1/config",
57 auth?.session
58 ? {
59 headers: {
60 Authorization: `Bearer ${auth.session}`,
61 },
62 }
63 : undefined
64 );
65 const data = await response.json();
66
67 return data.response as Config;
68 },
69 });
70};
71
72export { useConfig, compareInstanceVersions, isAtLeastInstanceVersion };

Callers 15

useTagsFunction · 0.90
useTagFunction · 0.90
ProfileDropdownFunction · 0.90
UserListingFunction · 0.90
PreservedFormatRowFunction · 0.90
PreservationNavbarFunction · 0.90
PreservationContentFunction · 0.90
UploadFileModalFunction · 0.90
NewUserModalFunction · 0.90
DeleteUserModalFunction · 0.90
InviteModalFunction · 0.90
RegisterFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected