Skip to content

Commit

Permalink
Chnages
Browse files Browse the repository at this point in the history
  • Loading branch information
vershwal committed Aug 22, 2024
1 parent 8a9e8aa commit 678354a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions ghost/core/core/server/models/base/plugins/crud.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const _ = require('lodash');
const errors = require('@tryghost/errors');

const tpl = require('@tryghost/tpl');
const db = require('../../../data/db');

const messages = {
couldNotUnderstandRequest: 'Could not understand request.'
Expand Down Expand Up @@ -80,7 +79,6 @@ module.exports = function (Bookshelf) {
* @param {Object} unfilteredOptions
*/
findPage: async function findPage(unfilteredOptions) {
const knex = db.knex;
const options = this.filterOptions(unfilteredOptions, 'findPage');
const itemCollection = this.getFilteredCollection(options);
const requestedColumns = options.columns;
Expand Down Expand Up @@ -125,7 +123,7 @@ module.exports = function (Bookshelf) {
if (Array.isArray(options.cte)) {
options.cte.forEach((cte) => {
itemCollection.query((qb) => {
qb.with(cte.name, knex.raw(cte.query));
qb.with(cte.name, qb.client.raw(cte.query));
});
});
}
Expand Down

0 comments on commit 678354a

Please sign in to comment.