issues with license mask and null in logo_url fixed

parent 6d46926f
......@@ -58,7 +58,7 @@ module.exports = {
Office.findOne({ id: id }).populate('admin').then(function (office) {
if (office) {
res.ok({logo_url: office.logo_url, name: office.name});
res.ok({logo_url: office.logo_url || '/app/img/logo_pictogram.png', name: office.name});
} else {
res.notFound();
}
......
......@@ -442,7 +442,7 @@ module.exports = {
// update supervisor office if it is linked as therapist
Supervisor.findOne({id: req.param('id_sup')})
.then((sup) => {
if (sup) {
if (sup && !sup.office) {
Student.findOne({id: req.param('id_stu')})
.then((stu) => {
if (stu) {
......
......@@ -87,7 +87,11 @@ module.exports = {
students: {
collection: "Student",
via: 'office'
}
},
toJSON: function() {
if (!attrs.logoUrl)
attrs.logoUrl = '/app/img/logo_pictogram.png';
}
},
beforeCreate: function (attrs, next) {
......
......@@ -49,7 +49,7 @@
</div>
<div class="form-group">
<label translate>license_number</label>
<input type="text" id="setup_license" class="form-control" mask="9999-9999-9999-9999" clean="true" placeholder="{{ 'license_number' | translate }}" ng-model="formUser.license_number" required>
<input type="text" id="setup_license" class="form-control" mask="wwww-wwww-wwww-wwww" clean="true" placeholder="{{ 'license_number' | translate }}" ng-model="formUser.license_number" required>
<div ng-show="studentData.license && !studentData.license_expired" class="alert alert-info" role="alert">
<i class="fa fa-info-circle" aria-hidden="true"></i> {{ 'license_expires' | translate }} {{ studentData.expiration_date }}
......
......@@ -26,7 +26,7 @@
</div>
<div class="form-group">
<input class="form-control" type="text" id="student_license" mask="9999-9999-9999-9999" clean="true" placeholder="{{ 'license_number' | translate }}" ng-model="formdatastudent.license_number" required>
<input class="form-control" type="text" id="student_license" mask="wwww-wwww-wwww-wwww" clean="true" placeholder="{{ 'license_number' | translate }}" ng-model="formdatastudent.license_number" required>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment