Created
February 18, 2022 09:46
-
-
Save yvesbou/d821230886a48015889b57c2c77e23d0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { models } = require("mongoose") | |
module.exports = async (_, {id, input}, {models}) => { | |
const ERC20CoinToUpdate = await models.ERC20Coin.findOne({_id: id}); | |
Object.keys(input).forEach(value => { | |
ERC20CoinToUpdate[value] = input[value]; | |
}); | |
const updatedERC20Coin = await ERC20CoinToUpdate.save(); | |
return updatedERC20Coin; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment