Created
July 27, 2019 09:20
-
-
Save jasongorman/c87966ab4e141a051d691b4f76bee7aa to your computer and use it in GitHub Desktop.
This file contains 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
receive(batch) { | |
const {title, artist, copies} = batch.cds[0]; | |
let cd = this.catalogue.search(title, artist); | |
if (cd == null) { | |
cd = this.catalogue.add(title, artist); | |
} | |
cd.addStock(copies); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment