mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Updated options parameter to be optional
no-issue Since updating the product repository to force transactions, the options parameter was used in every call, meaning it wasn't optional any more, which broke usage. This updates the parameter to have a default so that existing usage still works.
This commit is contained in:
parent
537c9cb02d
commit
66143dbb7c
1 changed files with 4 additions and 4 deletions
|
@ -48,7 +48,7 @@ class ProductRepository {
|
|||
*
|
||||
* @returns {Promise<ProductModel>}
|
||||
*/
|
||||
async get(data, options) {
|
||||
async get(data, options = {}) {
|
||||
if (!options.transacting) {
|
||||
return this._Product.transaction((transacting) => {
|
||||
return this.get(data, {
|
||||
|
@ -115,7 +115,7 @@ class ProductRepository {
|
|||
*
|
||||
* @returns {Promise<ProductModel>}
|
||||
**/
|
||||
async create(data, options) {
|
||||
async create(data, options = {}) {
|
||||
if (!this._stripeAPIService.configured && (data.stripe_prices || data.monthly_price || data.yearly_price)) {
|
||||
throw new UpdateCollisionError({
|
||||
message: 'The requested functionality requires Stripe to be configured. See https://ghost.org/integrations/stripe/',
|
||||
|
@ -250,7 +250,7 @@ class ProductRepository {
|
|||
*
|
||||
* @returns {Promise<ProductModel>}
|
||||
**/
|
||||
async update(data, options) {
|
||||
async update(data, options = {}) {
|
||||
if (!this._stripeAPIService.configured && (data.stripe_prices || data.monthly_price || data.yearly_price)) {
|
||||
throw new UpdateCollisionError({
|
||||
message: 'The requested functionality requires Stripe to be configured. See https://ghost.org/integrations/stripe/',
|
||||
|
@ -489,7 +489,7 @@ class ProductRepository {
|
|||
*
|
||||
* @returns {Promise<{data: ProductModel[], meta: object}>}
|
||||
**/
|
||||
async list(options) {
|
||||
async list(options = {}) {
|
||||
if (!options.transacting) {
|
||||
return this._Product.transaction((transacting) => {
|
||||
return this.list({
|
||||
|
|
Loading…
Add table
Reference in a new issue