refactor webhooks UI (#982)

This commit is contained in:
Alex Johansson authored and GitHub committed 2021-10-18 08:02:25 +01:00
1 parent 12f6065d84
commit d8dac426eb
13 files changed
+374 -616

No files matched your search

+1
View File
@@ -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,
+10 -1
View File
@@ -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,
};
},
})