Skip to content

Commit 637c58b

Browse files
committed
wip
1 parent 687ce70 commit 637c58b

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

app/Console/Commands/SyncArticleImages.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,14 @@ public function handle(): void
2828
$article->hero_image_url = $imageData['image_url'];
2929
$article->hero_image_author_name = $imageData['author_name'];
3030
$article->hero_image_author_url = $imageData['author_url'];
31-
$article->save();
31+
} else {
32+
$article->hero_image_id = null;
33+
$article->hero_image_url = null;
34+
$article->hero_image_author_name = null;
35+
$article->hero_image_author_url = null;
3236
}
37+
38+
$article->save();
3339
});
3440
});
3541
}

tests/Integration/Commands/SyncArticleImagesTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515

1616
Http::fake(function () {
1717
return [
18+
'links' => [
19+
'download_location' => 'https://example.com',
20+
],
1821
'urls' => [
1922
'raw' => 'https://images.unsplash.com/photo-1584824486509-112e4181ff6b?ixid=M3w2NTgwOTl8MHwxfGFsbHx8fHx8fHx8fDE3Mjc2ODMzMzZ8&ixlib=rb-4.0.3',
2023
],

0 commit comments

Comments
 (0)