feat: add public profiles

This commit is contained in:
David Nguyen
2024-06-06 14:46:48 +10:00
parent d11a68fc4c
commit 5514dad4d8
43 changed files with 2067 additions and 137 deletions

View File

@ -88,9 +88,9 @@ export const profileRouter = router({
.input(ZUpdatePublicProfileMutationSchema)
.mutation(async ({ input, ctx }) => {
try {
const { url } = input;
const { url, bio, enabled } = input;
if (IS_BILLING_ENABLED() && url.length < 6) {
if (IS_BILLING_ENABLED() && url !== undefined && url.length < 6) {
const subscriptions = await getSubscriptionsByUserId({
userId: ctx.user.id,
}).then((subscriptions) =>
@ -107,7 +107,11 @@ export const profileRouter = router({
const user = await updatePublicProfile({
userId: ctx.user.id,
url,
data: {
url,
bio,
enabled,
},
});
return { success: true, url: user.url };