mirror of
https://github.com/documenso/documenso.git
synced 2026-07-25 17:35:05 +10:00
feat: demo
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user