fix: format invite urls properly

This commit is contained in:
ryan 2023-08-28 20:59:18 +08:00
parent c320196ee8
commit 7bd3b8c7e1
1 changed files with 3 additions and 1 deletions

View File

@ -54,7 +54,9 @@ export class Invite {
@Property({ persist: false })
@Field(() => String)
get url() {
return `${config.rootHost.url}/${this.path}`;
const url = new URL(config.rootHost.url);
url.pathname = this.path;
return url;
}
[OptionalProps]: 'url' | 'path' | 'consumed' | 'expired' | 'createdAt' | 'skipVerification';