feat: demo

This commit is contained in:
David Nguyen
2024-03-27 20:31:08 +08:00
parent 2c8d11c37d
commit 824f4a070a
8 changed files with 136 additions and 11 deletions
+2 -1
View File
@@ -9,6 +9,7 @@ import type {
} from '@documenso/prisma/client';
import { RECIPIENT_ROLES_DESCRIPTION } from '../constants/recipient-roles';
import { AppError } from '../errors/app-error';
import type {
TDocumentAuditLog,
TDocumentAuditLogDocumentMetaDiffSchema,
@@ -69,7 +70,7 @@ export const parseDocumentAuditLogData = (auditLog: DocumentAuditLog): TDocument
// Handle any required migrations here.
if (!data.success) {
console.error(data.error);
throw new Error('Migration required');
throw new AppError('MIGRATION_REQUIRED');
}
return data.data;
+16
View File
@@ -0,0 +1,16 @@
import type { LoggerConfig } from 'next-axiom';
import { Logger } from 'next-axiom';
/**
* For usage in server-side code.
*
* When used in a server component, you must flush the logs.
*
* https://github.com/axiomhq/next-axiom?tab=readme-ov-file#server-components
*/
export const buildServerLogger = (config?: LoggerConfig) => {
return new Logger({
source: 'server',
...config,
});
};