0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Fixed update method for Products repository

no-issue

When updating a Product we can pass existing Stripe Prices, these will
either be adding to the database, or updated if they already exist. When
updating them we were attemping to use the `id` passed in the update,
which is not necessarily included. Instead we should use the `id` of the
StripePrice which we have already retrieved from the database.
This commit is contained in:
Fabien O'Carroll 2021-04-26 14:00:32 +01:00
parent 20e5dcc91d
commit 4e98c62b71

View file

@ -216,7 +216,7 @@ class ProductRepository {
nickname: existingPrice.nickname nickname: existingPrice.nickname
}, { }, {
...options, ...options,
id: existingPrice.id || options.id id: stripePrice.id
}); });
} }
} }