Comparing version 2.13.33 to 2.13.34
@@ -239,2 +239,5 @@ "use strict"; | ||
throw new error_1.ValidationError('role'); | ||
if (!current && expire === domain.JOIN_EXPIRATION_KEEP_CURRENT) | ||
throw new error_1.ValidationError('expire'); | ||
joinSettings = { method, role }; | ||
if (expire === domain.JOIN_EXPIRATION_KEEP_CURRENT) | ||
@@ -248,9 +251,6 @@ joinSettings.expire = current.expire; | ||
joinSettings.expire = moment_timezone_1.default().add(expire, 'hours').toDate(); | ||
if (!current && expire === domain.JOIN_EXPIRATION_KEEP_CURRENT) | ||
throw new error_1.ValidationError('expire'); | ||
joinSettings = { method, role }; | ||
if (method === domain.JOIN_METHOD_CODE) | ||
joinSettings.code = invitationCode; | ||
} | ||
await domain.edit(this.domain._id, { join: joinSettings }); | ||
await domain.edit(domainId, { join: joinSettings }); | ||
this.back(); | ||
@@ -262,3 +262,3 @@ } | ||
server_1.param('role', server_1.Types.String, true), | ||
server_1.param('expire', server_1.Types.UnsignedInt, true), | ||
server_1.param('expire', server_1.Types.Int, true), | ||
server_1.param('invitationCode', server_1.Types.String, true) | ||
@@ -265,0 +265,0 @@ ], DomainJoinApplicationsHandler.prototype, "post", null); |
{ | ||
"name": "hydrooj", | ||
"version": "2.13.33", | ||
"version": "2.13.34", | ||
"bin": "bin/hydrooj.js", | ||
@@ -5,0 +5,0 @@ "main": "dist/loader.js", |
@@ -215,3 +215,3 @@ import moment from 'moment-timezone'; | ||
@param('role', Types.String, true) | ||
@param('expire', Types.UnsignedInt, true) | ||
@param('expire', Types.Int, true) | ||
@param('invitationCode', Types.String, true) | ||
@@ -226,2 +226,4 @@ async post(domainId: string, method: number, role: string, expire: number, invitationCode = '') { | ||
if (!roles.includes(role)) throw new ValidationError('role'); | ||
if (!current && expire === domain.JOIN_EXPIRATION_KEEP_CURRENT) throw new ValidationError('expire'); | ||
joinSettings = { method, role }; | ||
if (expire === domain.JOIN_EXPIRATION_KEEP_CURRENT) joinSettings.expire = current.expire; | ||
@@ -231,7 +233,5 @@ else if (expire === domain.JOIN_EXPIRATION_UNLIMITED) joinSettings.expire = null; | ||
else joinSettings.expire = moment().add(expire, 'hours').toDate(); | ||
if (!current && expire === domain.JOIN_EXPIRATION_KEEP_CURRENT) throw new ValidationError('expire'); | ||
joinSettings = { method, role }; | ||
if (method === domain.JOIN_METHOD_CODE) joinSettings.code = invitationCode; | ||
} | ||
await domain.edit(this.domain._id, { join: joinSettings }); | ||
await domain.edit(domainId, { join: joinSettings }); | ||
this.back(); | ||
@@ -238,0 +238,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1729520