Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ class Service extends AdapterService {
* `find` service function for Objection.
* @param params
*/
_find (params) {
_find (params = {}) {
const find = (params, count, filters, query) => {
const q = params.objection || this.createQuery(params);
const groupByColumns = this.getGroupByColumns(q);
Expand Down Expand Up @@ -599,7 +599,7 @@ class Service extends AdapterService {
return result;
}

_get (id, params) {
_get (id, params = {}) {
// merge user query with the 'id' to get
const findQuery = Object.assign({}, { $and: [] }, params.query);
findQuery.$and.push(this.getIdsQuery(id));
Expand Down Expand Up @@ -695,7 +695,7 @@ class Service extends AdapterService {
* @param {object} data
* @param {object} params
*/
async _create (data, params) {
async _create (data, params = {}) {
const transaction = await this._createTransaction(params);
const q = this._createQuery(params);
let promise = q;
Expand Down Expand Up @@ -725,7 +725,7 @@ class Service extends AdapterService {
* @param data
* @param params
*/
_update (id, data, params) {
_update (id, data, params = {}) {
// NOTE : First fetch the item to update to account for user query
return this._get(id, params)
.then(() => {
Expand Down Expand Up @@ -790,7 +790,7 @@ class Service extends AdapterService {
* @param data
* @param params
*/
_patch (id, data, params) {
_patch (id, data, params = {}) {
let { filters, query } = this.filterQuery(params);

const allowedUpsert = this.mergeRelations(this.allowedUpsert, params.mergeAllowUpsert);
Expand Down Expand Up @@ -881,7 +881,7 @@ class Service extends AdapterService {
* @param id
* @param params
*/
_remove (id, params) {
_remove (id, params = {}) {
params.query = Object.assign({}, params.query);

// NOTE (EK): First fetch the record so that we can return
Expand Down