Skip to content
Open
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
9 changes: 3 additions & 6 deletions apps/cyberstorm-remix/app/p/packageListing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import {
import { PackageLikeAction } from "@thunderstore/cyberstorm-forms";
import type { CurrentUser } from "@thunderstore/dapper/types";
import { DapperTs, type DapperTsInterface } from "@thunderstore/dapper-ts";
import { getDapperForRequest } from "cyberstorm/utils/dapperSingleton";
import { getPublicListing, getPrivateListing } from "./listingUtils";
import { ManagementTools } from "./components/PackageListing/ManagementTools";

Expand Down Expand Up @@ -132,19 +133,15 @@ async function getPackageListingStatus(
return undefined;
}

export async function clientLoader({ params }: LoaderFunctionArgs) {
export async function clientLoader({ params, request }: LoaderFunctionArgs) {
const { communityId, namespaceId, packageId } = params;

if (!communityId || !namespaceId || !packageId) {
throw new Response("Package not found", { status: 404 });
}

const tools = getSessionTools();
const config = tools.getConfig();
const dapper = new DapperTs(() => ({
apiHost: config.apiHost,
sessionId: config.sessionId,
}));
const dapper = getDapperForRequest(request);

const listing = await getPrivateListing(dapper, {
communityId,
Expand Down
15 changes: 4 additions & 11 deletions apps/cyberstorm-remix/app/p/packageListingVersion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@ import {
import { DapperTs } from "@thunderstore/dapper-ts";
import { type OutletContextShape } from "~/root";
import { CopyButton } from "~/commonComponents/CopyButton/CopyButton";
import {
getPublicEnvVariables,
getSessionTools,
} from "cyberstorm/security/publicEnvVariables";
import { getPublicEnvVariables } from "cyberstorm/security/publicEnvVariables";
import { getDapperForRequest } from "cyberstorm/utils/dapperSingleton";
import { getPrivateListing, getPublicListing } from "./listingUtils";
import {
type PackageListingDetails,
Expand Down Expand Up @@ -77,19 +75,14 @@ export async function loader({ params }: LoaderFunctionArgs) {
};
}

export async function clientLoader({ params }: LoaderFunctionArgs) {
export async function clientLoader({ params, request }: LoaderFunctionArgs) {
const { communityId, namespaceId, packageId, packageVersion } = params;

if (!communityId || !namespaceId || !packageId || !packageVersion) {
throw new Response("Package not found", { status: 404 });
}

const tools = getSessionTools();
const config = tools.getConfig();
const dapper = new DapperTs(() => ({
apiHost: config.apiHost,
sessionId: config.sessionId,
}));
const dapper = getDapperForRequest(request);

const listing = await getPrivateListing(dapper, {
communityId,
Expand Down

This file was deleted.

This file was deleted.

Loading
Loading