much 2 yearn
much 2 yearn
Explore posts from servers
DTDrizzle Team
Created by much 2 yearn on 9/25/2024 in #help
Where clause on 'with' in findMany
export const getOrgsByMembershipList = cache(async () => {
const user = await getAuthUser();

if (!user) {
throw new Error("User not found");
}

const result = await db.query.membership.findMany({
where: eq(membership.profileId, user.id),
with: {
org: {
columns: {
id: true,
name: true,
},
where: eq(org.defaultOrg, false),
},
},
});

return result;
});
export const getOrgsByMembershipList = cache(async () => {
const user = await getAuthUser();

if (!user) {
throw new Error("User not found");
}

const result = await db.query.membership.findMany({
where: eq(membership.profileId, user.id),
with: {
org: {
columns: {
id: true,
name: true,
},
where: eq(org.defaultOrg, false),
},
},
});

return result;
});
7 replies
TTCTheo's Typesafe Cult
Created by much 2 yearn on 10/14/2023 in #questions
React Native Expo: Take photo with camera and send email with attachment
My current implementation does not work 100% of the time. I am using expo image manipulator and expo print for photos and transforming them. Any advice or direction would be appreciated
3 replies
TTCTheo's Typesafe Cult
Created by much 2 yearn on 8/18/2023 in #questions
T3 real-time / offline
I have a t3 app i made a PWA. I would like to integrate some offline first functionality but there are very few resources regarding this matter that are not - rudimentary dives into indexdb with no sync with your db - graphql solutions (aws amplify / data store , rxdb, couchdb ) Is there a way to support offline first with good database synchronization with t3 stack code base ? I enjoy the stack and would prefer to keep it vs going to a gql alternative
4 replies
TTCTheo's Typesafe Cult
Created by much 2 yearn on 8/8/2023 in #questions
tRPC in nextjs Capacitor app
is it possible to have tRPC in app like this? Capacitor uses an exported static next app so it wont have access to server req/res for trpc contexts. But is it possible to use it for just a wrapper with react-query? I don't believe you can use next auth in an app like this for similar reasons, but I think its possible to use trpc
3 replies
TTCTheo's Typesafe Cult
Created by much 2 yearn on 12/22/2022 in #questions
trpc + Auth0 + turborepo
Hello! I want to build a sass web and mobile application that follows the create-t3-turbo repo. Expo does not support nextAuth so I was wondering what are the implications when using two different auth tools for the apps? I was thinking using auth0. I am using prisma / trpc and most of the examples out there are integrated with just nexAuth. Second question, does anyone have a good repo that uses these tools? Mainly configuring the auth0 middleware with trpc?
4 replies
TTCTheo's Typesafe Cult
Created by much 2 yearn on 9/17/2022 in #questions
Prisma 1-n relation create question
1 replies