beerman
beerman
CCConvex Community
Created by beerman on 10/16/2024 in #general
Svelte SSR
can you dm me your gh username
59 replies
CCConvex Community
Created by beerman on 10/16/2024 in #general
Svelte SSR
You should get somebody to make sure all documentation is up to date
59 replies
CCConvex Community
Created by beerman on 10/16/2024 in #general
Svelte SSR
Yeah, there's a lot of information. This is like the second or third time you've told me something has changed.
59 replies
CCConvex Community
Created by beerman on 10/16/2024 in #general
Svelte SSR
Dang, right as I converted most of my schema.
59 replies
CCConvex Community
Created by beerman on 10/16/2024 in #general
Svelte SSR
Shall I add you as a collaborator to my repo?
59 replies
CCConvex Community
Created by beerman on 10/16/2024 in #general
Svelte SSR
I just found out about your Table helper so I'm reading through that to see if I find anything useful. Honestly, your documentation and stack.convex are all over the place.
59 replies
CCConvex Community
Created by beerman on 10/16/2024 in #general
Svelte SSR
What's the best way to validate this param? I wanted to do
const validate = PropertyStatusValidator.safeParse(params.status)
if (!validation.success) redirect(302, "/properties");
const status = validation.data;

return {
status,
properties: await client.query(api.getProperties.get, {
status,
}),
};
const validate = PropertyStatusValidator.safeParse(params.status)
if (!validation.success) redirect(302, "/properties");
const status = validation.data;

return {
status,
properties: await client.query(api.getProperties.get, {
status,
}),
};
` but convex validators don't have that method, so the above was the next cleanest way I could think of, but it looks like there's an incompatibility with SSR so I'm not sure how to do this anymore.
59 replies
CCConvex Community
Created by beerman on 10/16/2024 in #general
Svelte SSR
It happens when I import import { type PropertyStatusType } from "../../../convex/getProperties.ts"; into my +page.server.ts
import { ConvexHttpClient } from "convex/browser";
import { PUBLIC_CONVEX_URL } from "$env/static/public";
import { api } from "../../../convex/_generated/api.js";
import { redirect } from "@sveltejs/kit";
import { type PropertyStatusType } from "../../../convex/getProperties.ts";

// * @type {import('../../../../.svelte-kit/types/src/routes/properties/[status]/$types.d.ts').PageServerLoad}
export async function load(
{ params }: { params: { status: string } },
) {
const client = new ConvexHttpClient(PUBLIC_CONVEX_URL!);

if (!["for-sale", "for-rent"].includes(params.status)) {
redirect(302, "/properties");
}

const status = params.status as PropertyStatusType;

return {
status,
properties: await client.query(api.getProperties.get, {
status,
}),
};
}
import { ConvexHttpClient } from "convex/browser";
import { PUBLIC_CONVEX_URL } from "$env/static/public";
import { api } from "../../../convex/_generated/api.js";
import { redirect } from "@sveltejs/kit";
import { type PropertyStatusType } from "../../../convex/getProperties.ts";

// * @type {import('../../../../.svelte-kit/types/src/routes/properties/[status]/$types.d.ts').PageServerLoad}
export async function load(
{ params }: { params: { status: string } },
) {
const client = new ConvexHttpClient(PUBLIC_CONVEX_URL!);

if (!["for-sale", "for-rent"].includes(params.status)) {
redirect(302, "/properties");
}

const status = params.status as PropertyStatusType;

return {
status,
properties: await client.query(api.getProperties.get, {
status,
}),
};
}
59 replies
CCConvex Community
Created by beerman on 10/16/2024 in #general
Svelte SSR
No description
59 replies
CCConvex Community
Created by beerman on 10/16/2024 in #general
Svelte SSR
This looks like an invalid one off bug sort of thing
59 replies
CCConvex Community
Created by beerman on 10/16/2024 in #general
Svelte SSR
I'm gonna try clear my project cache
59 replies
CCConvex Community
Created by beerman on 10/16/2024 in #general
Svelte SSR
No description
59 replies
CCConvex Community
Created by beerman on 10/16/2024 in #general
Svelte SSR
No, only as parameter types
59 replies
CCConvex Community
Created by beerman on 10/16/2024 in #general
Svelte SSR
No description
59 replies
CCConvex Community
Created by beerman on 10/16/2024 in #general
Svelte SSR
No description
59 replies
CCConvex Community
Created by beerman on 10/16/2024 in #general
Svelte SSR
No description
59 replies
CCConvex Community
Created by beerman on 10/16/2024 in #general
Svelte SSR
No description
59 replies
CCConvex Community
Created by beerman on 10/16/2024 in #general
Svelte SSR
No description
59 replies
CCConvex Community
Created by beerman on 10/16/2024 in #general
Svelte SSR
I'm really confused
59 replies
CCConvex Community
Created by beerman on 10/16/2024 in #general
Svelte SSR
No description
59 replies