0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Fixed edit method to accept a string

refs https://github.com/TryGhost/Team/issues/2078

This fixes a bug with the edit method where we passed a raw string
rather than ObjectID
This commit is contained in:
Fabien "egg" O'Carroll 2022-10-20 11:51:18 +07:00
parent 93e392fac1
commit 9e7b009236

View file

@ -81,7 +81,8 @@ module.exports = class TiersAPI {
* @param {object} data
* @returns {Promise<Tier>}
*/
async edit(id, data) {
async edit(idString, data) {
const id = ObjectID.createFromHexString(idString);
const tier = await this.#repository.getById(id);
const editableProperties = [