♻️ Refactor code for generating absolute url (#904)

This commit is contained in:
Luke Vella 2023-10-19 18:01:00 +01:00 committed by GitHub
parent eaa8f5813d
commit 703d551aac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 108 additions and 61 deletions

View file

@ -8,6 +8,13 @@ export interface TRPCContext {
emailClient: EmailClient;
isSelfHosted: boolean;
isEmailBlocked?: (email: string) => boolean;
/**
* Takes a relative path and returns an absolute URL to the app
* @param path
* @returns absolute URL
*/
absoluteUrl: (path?: string) => string;
shortUrl: (path?: string) => string;
}
export const trpcNextApiHandler = (context: TRPCContext) => {