chore: ui updates

This commit is contained in:
Mythie
2024-02-26 22:24:23 +11:00
parent 15c22d3897
commit 70165c4469
9 changed files with 210 additions and 149 deletions

View File

@ -5,6 +5,7 @@ import { validateApiToken } from '@documenso/lib/server-only/webhooks/zapier/val
export const testCredentialsHandler = async (req: NextApiRequest, res: NextApiResponse) => {
try {
const { authorization } = req.headers;
const user = await validateApiToken({ authorization });
return res.status(200).json({

View File

@ -1,17 +0,0 @@
import { prisma } from '@documenso/prisma';
export interface GetUserWebhooksByIdOptions {
id: number;
}
export const getUserWebhooksById = async ({ id }: GetUserWebhooksByIdOptions) => {
return await prisma.user.findFirstOrThrow({
where: {
id,
},
select: {
email: true,
Webhooks: true,
},
});
};

View File

@ -0,0 +1,3 @@
export const toFriendlyWebhookEventName = (eventName: string) => {
return eventName.replace(/_/g, '.').toLowerCase();
};