refactor webhooks UI (#982)
This commit is contained in:
1 parent
12f6065d84
commit
d8dac426eb
13 files changed
+374
-616
No files matched your search
@@ -34,6 +34,7 @@ async function getUserFromSession({ session, req }: { session: Maybe<Session>; r
|
||||
createdDate: true,
|
||||
hideBranding: true,
|
||||
avatar: true,
|
||||
twoFactorEnabled: true,
|
||||
credentials: {
|
||||
select: {
|
||||
id: true,
|
||||
|
||||
@@ -139,7 +139,9 @@ const loggedInViewerRouter = createProtectedRouter()
|
||||
},
|
||||
});
|
||||
|
||||
if (!user) throw new TRPCError({ code: "INTERNAL_SERVER_ERROR" });
|
||||
if (!user) {
|
||||
throw new TRPCError({ code: "INTERNAL_SERVER_ERROR" });
|
||||
}
|
||||
|
||||
// backwards compatibility, TMP:
|
||||
const typesRaw = await prisma.eventType.findMany({
|
||||
@@ -363,6 +365,12 @@ const loggedInViewerRouter = createProtectedRouter()
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
const webhooks = await ctx.prisma.webhook.findMany({
|
||||
where: {
|
||||
userId: user.id,
|
||||
},
|
||||
});
|
||||
return {
|
||||
conferencing: {
|
||||
items: conferencing,
|
||||
@@ -377,6 +385,7 @@ const loggedInViewerRouter = createProtectedRouter()
|
||||
numActive: countActive(payment),
|
||||
},
|
||||
connectedCalendars,
|
||||
webhooks,
|
||||
};
|
||||
},
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user