Update Clerk Organization from TRPC Router

Hello, if anyone got an idea on how to handle this I would highly appreciate it. I have some organizations in my app and I have stored some information on the publicMetadata. I have a settings panel where an admin user will be able to change this information. I have read https://clerk.com/docs/nextjs/trpc as well as setting up the context like this project https://github.com/perkinsjr/t3-app-clerk-minimal/blob/main/src/server/api/trpc.ts, but i've not been able to figure it out... Would I need to make an axios request from inside the procedure? How would i go on about making this update procedure? I've tried a few ways without success, any guidance would be highly appreciated.
TRPC | Clerk
Learn how to integrate Clerk into your Next.js with TRPC
1 Reply
James Perkins
James Perkins2y ago
I know I answered over there but in case someone happened to be in here looking for it.
await clerkClient.organizations.updateOrganization("id",{
name: "new name",
maxAllowedMemberships: 10,
slug: "new-slug",
privateMetadata: {
"key": "value"
},
publicMetadata: {
"key": "value"
}
})
await clerkClient.organizations.updateOrganization("id",{
name: "new name",
maxAllowedMemberships: 10,
slug: "new-slug",
privateMetadata: {
"key": "value"
},
publicMetadata: {
"key": "value"
}
})
Want results from more Discord servers?
Add your server