Added core
type integrations to API serializer
This commit is contained in:
parent
0e284edbad
commit
5ac779f86b
@ -3,9 +3,9 @@ const debug = require('@tryghost/debug')('api:endpoints:utils:serializers:input:
|
||||
|
||||
function setDefaultFilter(frame) {
|
||||
if (frame.options.filter) {
|
||||
frame.options.filter = `(${frame.options.filter})+type:[custom,builtin]`;
|
||||
frame.options.filter = `(${frame.options.filter})+type:[custom,builtin,core]`;
|
||||
} else {
|
||||
frame.options.filter = 'type:[custom,builtin]';
|
||||
frame.options.filter = 'type:[custom,builtin,core]';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@ describe('Unit: endpoints/utils/serializers/input/pages', function () {
|
||||
};
|
||||
|
||||
serializers.input.integrations.browse(apiConfig, frame);
|
||||
frame.options.filter.should.eql('type:[custom,builtin]');
|
||||
frame.options.filter.should.eql('type:[custom,builtin,core]');
|
||||
});
|
||||
|
||||
it('combines filters', function () {
|
||||
@ -25,7 +25,7 @@ describe('Unit: endpoints/utils/serializers/input/pages', function () {
|
||||
};
|
||||
|
||||
serializers.input.integrations.browse(apiConfig, frame);
|
||||
frame.options.filter.should.eql('(type:internal)+type:[custom,builtin]');
|
||||
frame.options.filter.should.eql('(type:internal)+type:[custom,builtin,core]');
|
||||
});
|
||||
});
|
||||
|
||||
@ -39,7 +39,7 @@ describe('Unit: endpoints/utils/serializers/input/pages', function () {
|
||||
};
|
||||
|
||||
serializers.input.integrations.read(apiConfig, frame);
|
||||
frame.options.filter.should.eql('type:[custom,builtin]');
|
||||
frame.options.filter.should.eql('type:[custom,builtin,core]');
|
||||
});
|
||||
|
||||
it('combines filters', function () {
|
||||
@ -52,7 +52,7 @@ describe('Unit: endpoints/utils/serializers/input/pages', function () {
|
||||
};
|
||||
|
||||
serializers.input.integrations.read(apiConfig, frame);
|
||||
frame.options.filter.should.eql('(type:internal)+type:[custom,builtin]');
|
||||
frame.options.filter.should.eql('(type:internal)+type:[custom,builtin,core]');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -60,11 +60,11 @@ describe('Unit: models/integration', function () {
|
||||
return models.Integration.findOne({
|
||||
id: '123'
|
||||
}, {
|
||||
filter: 'type:[custom,builtin]'
|
||||
filter: 'type:[custom,builtin,core]'
|
||||
}).then(() => {
|
||||
queries.length.should.eql(1);
|
||||
queries[0].sql.should.eql('select `integrations`.* from `integrations` where `integrations`.`type` in (?, ?) and `integrations`.`id` = ? limit ?');
|
||||
queries[0].bindings.should.eql(['custom', 'builtin', '123', 1]);
|
||||
queries[0].sql.should.eql('select `integrations`.* from `integrations` where `integrations`.`type` in (?, ?, ?) and `integrations`.`id` = ? limit ?');
|
||||
queries[0].bindings.should.eql(['custom', 'builtin', 'core', '123', 1]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user