Set the domain and subdomain in details

This commit is contained in:
Girish Ramakrishnan
2019-09-27 14:42:18 -07:00
parent 18a2107247
commit ce9224c690

View File

@@ -689,10 +689,10 @@ function validateLocations(locations, callback) {
if (error) return callback(error);
for (let location of locations) {
if (!(location.domain in domainObjectMap)) return callback(new AppsError(AppsError.BAD_FIELD, 'No such domain', { field: 'location' }));
if (!(location.domain in domainObjectMap)) return callback(new AppsError(AppsError.BAD_FIELD, 'No such domain', { field: 'location', domain: location.domain, subdomain: location.subdomain }));
error = domains.validateHostname(location.subdomain, domainObjectMap[location.domain]);
if (error) return callback(new AppsError(AppsError.BAD_FIELD, 'Bad location: ' + error.message, { field: 'location', location }));
if (error) return callback(new AppsError(AppsError.BAD_FIELD, 'Bad location: ' + error.message, { field: 'location', domain: location.domain, subdomain: location.subdomain }));
}
callback(null, domainObjectMap);