This commit is contained in:
Tom Moor
2018-11-11 21:17:03 -08:00
parent c81135c09e
commit 61138ff4fa
7 changed files with 9 additions and 12 deletions

View File

@ -45,13 +45,15 @@ const Team = sequelize.define(
{
getterMethods: {
url() {
if (!this.subdomain) return process.env.URL;
if (!this.subdomain || !process.env.SUBDOMAINS_ENABLED) {
return process.env.URL;
}
const url = new URL(process.env.URL);
url.host = `${this.subdomain}.${url.host}`;
return url.href.replace(/\/$/, '');
},
logo() {
logoUrl() {
return (
this.avatarUrl || (this.slackData ? this.slackData.image_88 : null)
);