mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 19:33:02 +03:00
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:
parent
01a1a83c52
commit
a953b530c3
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user