-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Check the amount of TP items to be published #482
Conversation
Pull Request Test Coverage Report for Build 2102601502
💛 - Coveralls |
src/Collection/Collection.router.ts
Outdated
const availableSlots = await this.tpService.getThirdPartyAvailableSlots( | ||
dbCollection.third_party_id | ||
) | ||
if (itemIds.length > availableSlots) { | ||
throw new HTTPError( | ||
'The amount of items to publish exceeds the available slots', | ||
null, | ||
STATUS_CODES.badRequest | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind putting this into the publishTPCollection
method?
We'll need to create a custom Error and catch it as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, what if we use a 409 for this error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely! updated :)
Closes #480