Returned null when updateOffer does not find Offer

no-issue

This is another improvement for the API so that we can correctly handle
404's
This commit is contained in:
Fabien O'Carroll 2021-10-22 14:43:52 +02:00
parent 01a1a83c52
commit a953b530c3

View File

@ -71,6 +71,10 @@ class OffersAPI {
const offer = await this.repository.getById(data.id, options);
if (!offer) {
return null;
}
if (Reflect.has(data, 'name')) {
const name = OfferName.create(data.name);
await offer.updateName(name, uniqueChecker);