muadpn
muadpn
TTCTheo's Typesafe Cult
Created by Giuliopime on 6/17/2024 in #questions
Dialog shadcn not showing up as a dialog but just as content
Did you use cli?
6 replies
TTCTheo's Typesafe Cult
Created by CyberHero36 on 6/16/2024 in #questions
How do I merge two Zod schemas?
soo valid object are either:
* @example {"type" : "path", path: { nextPath: "page", webPath: "/projects"}}
* @example {"type" : "tag", tag: ["project_id", "data"]}
* @example {"type" : "path", path: { nextPath: "page", webPath: "/projects"}}
* @example {"type" : "tag", tag: ["project_id", "data"]}
7 replies
TTCTheo's Typesafe Cult
Created by CyberHero36 on 6/16/2024 in #questions
How do I merge two Zod schemas?
import { z } from "zod";

const pathSchema = z.object({
nextPath: z.enum(["page", "layout"]),
webPath: z.string(),
});

// Define the schema for the "tag" type
const tagSchema = z.object({
tags: z.array(z.string()),
});

// Define the overall schema with a discriminator
export const revalidateRequestSchema = z
.object({
type: z.enum(["path", "tag"]),
})
.and(
z.union([
z.object({
type: z.literal("path"),
path: pathSchema,
}),
z.object({
type: z.literal("tag"),
tags: tagSchema.shape.tags,
}),
])
);

export type RevalidateRequestData = z.infer<typeof revalidateRequestSchema>;
import { z } from "zod";

const pathSchema = z.object({
nextPath: z.enum(["page", "layout"]),
webPath: z.string(),
});

// Define the schema for the "tag" type
const tagSchema = z.object({
tags: z.array(z.string()),
});

// Define the overall schema with a discriminator
export const revalidateRequestSchema = z
.object({
type: z.enum(["path", "tag"]),
})
.and(
z.union([
z.object({
type: z.literal("path"),
path: pathSchema,
}),
z.object({
type: z.literal("tag"),
tags: tagSchema.shape.tags,
}),
])
);

export type RevalidateRequestData = z.infer<typeof revalidateRequestSchema>;
maybe this helps?
7 replies
TTCTheo's Typesafe Cult
Created by Valentin on 1/24/2024 in #questions
How hard is it to enter the computer science master in University of Copenhagen?
lol dude, its a wrong server and channel and community to be asking this question. its totaly unrelated to this or whatever, I am sure you will find answer on some other related discord channel | server to be asking this question
8 replies
TTCTheo's Typesafe Cult
Created by Valentin on 1/24/2024 in #questions
How hard is it to enter the computer science master in University of Copenhagen?
Hey @Valentin , maybe instead of relying on internet forums, try the passionate pigeon approach!,Tie your resume to its leg for that extra touch. 🐦 @Vincent's realism might not have been what you wanted, but trust the avian vibes. Who knows, the admissions committee might appreciate the creativity! 🤷‍♂️ #PassionatePigeonAdmissions
8 replies
TTCTheo's Typesafe Cult
Created by abhijay on 1/23/2024 in #questions
what filetypes are supported and how to implement in uploadthing nextjs?
use blob and check the file type? or use pdf end point or docx end point i guess.
4 replies
KKinde
Created by muadpn on 1/19/2024 in #💻┃support
Firebase auth with Kinde. for firebase storage to write security access
does this has any limitations ?
5 replies
KKinde
Created by muadpn on 1/19/2024 in #💻┃support
Firebase auth with Kinde. for firebase storage to write security access
also cant i do something like, custom_token in firebase ? that is signed by admin sdk? amd assign a uuid to the user and save it into database ? authenticate with the user with the uuid each time sign in ?
5 replies
KKinde
Created by muadpn on 1/19/2024 in #💻┃support
Firebase auth with Kinde. for firebase storage to write security access
limited in? firebase | kinde ?
5 replies