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'
|
message: 'Company has to be official'
|
||||||
});
|
});
|
||||||
|
|
||||||
async function isOfficialCompany(value) {
|
async function isOfficialCompany(err, done) {
|
||||||
const company = await Self.app.models.Company.findById(value);
|
const hasCompany = await Self.app.models.Company.exists(this.companyFk);
|
||||||
return company.isOfficial;
|
if (!hasCompany) err();
|
||||||
|
done();
|
||||||
}
|
}
|
||||||
|
|
||||||
Self.observe('before save', async function(ctx) {
|
Self.observe('before save', async function(ctx) {
|
||||||
|
|
Loading…
Reference in New Issue