Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/general #1174

Merged
merged 4 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions src/web/src/pages/admin/links/[[...query]]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
type LinkSearchResult,
} from "~/api/models/actionLinks";
import {
createLinkSharing,
getLinkById,
searchLinks,
updateLinkStatus,
} from "~/api/services/actionLinks";
Expand Down Expand Up @@ -324,21 +324,14 @@ const Links: NextPageWithLayout<{
// fetch the QR code
queryClient
.fetchQuery({
queryKey: ["OpportunitySharingLinkQR", item.entityId],
queryFn: () =>
createLinkSharing({
name: null,
description: null,
entityType: item.entityType,
entityId: item.entityId,
includeQRCode: true,
}),
queryKey: ["OpportunityLink", item.id],
queryFn: () => getLinkById(item.id, true),
})
.then(() => {
// get the QR code from the cache
const qrCode = queryClient.getQueryData<LinkInfo | null>([
"OpportunitySharingLinkQR",
item.entityId,
"OpportunityLink",
item.id,
]);

// show the QR code
Expand Down Expand Up @@ -562,6 +555,7 @@ const Links: NextPageWithLayout<{
src={qrCodeImageData}
alt="QR Code"
width={200}
height={200}
className="h-auto"
/>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,14 +331,14 @@ const Links: NextPageWithLayout<{
// fetch the QR code
queryClient
.fetchQuery({
queryKey: ["OpportunitySharingLinkQR", item.entityId],
queryKey: ["OpportunityLink", item.id],
queryFn: () => getLinkById(item.id, true),
})
.then(() => {
// get the QR code from the cache
const qrCode = queryClient.getQueryData<LinkInfo | null>([
"OpportunitySharingLinkQR",
item.entityId,
"OpportunityLink",
item.id,
]);

// show the QR code
Expand Down Expand Up @@ -517,6 +517,7 @@ const Links: NextPageWithLayout<{
src={qrCodeImageData}
alt="QR Code"
width={200}
height={200}
className="h-auto"
/>
</>
Expand Down
Loading