fallo validateasync
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
3026ca8d69
commit
4b302915b5
|
@ -15,9 +15,10 @@ module.exports = function(Self) {
|
|||
message: 'Company has to be official'
|
||||
});
|
||||
|
||||
async function isOfficialCompany(value) {
|
||||
const company = await Self.app.models.Company.findById(value);
|
||||
return company.isOfficial;
|
||||
async function isOfficialCompany(err, done) {
|
||||
const hasCompany = await Self.app.models.Company.exists(this.companyFk);
|
||||
if (!hasCompany) err();
|
||||
done();
|
||||
}
|
||||
|
||||
Self.observe('before save', async function(ctx) {
|
||||
|
|
Loading…
Reference in New Issue