mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05: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
1 changed files with 4 additions and 0 deletions
|
@ -71,6 +71,10 @@ class OffersAPI {
|
||||||
|
|
||||||
const offer = await this.repository.getById(data.id, options);
|
const offer = await this.repository.getById(data.id, options);
|
||||||
|
|
||||||
|
if (!offer) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if (Reflect.has(data, 'name')) {
|
if (Reflect.has(data, 'name')) {
|
||||||
const name = OfferName.create(data.name);
|
const name = OfferName.create(data.name);
|
||||||
await offer.updateName(name, uniqueChecker);
|
await offer.updateName(name, uniqueChecker);
|
||||||
|
|
Loading…
Add table
Reference in a new issue