Merge pull request #4669 from pixelfed/staging

Update StatusTagsPipeline, fix object tags slug query
pull/4679/head
daniel 2023-09-25 05:14:22 -06:00 zatwierdzone przez GitHub
commit dcc6f65e33
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 9 dodań i 8 usunięć

Wyświetl plik

@ -81,16 +81,17 @@ class StatusTagsPipeline implements ShouldQueue
->orWhere('slug', 'ilike', str_slug($name, '-', false))
->first();
if(!$hashtag) {
$hashtag = new Hashtag;
$hashtag->name = $name;
$hashtag->slug = str_slug($name, '-', false);
$hashtag->save();
}
if(!$hashtag) {
$hashtag = Hashtag::updateOrCreate([
'slug' => str_slug($name, '-', false),
],[
'name' => $name
]);
}
} else {
$hashtag = Hashtag::firstOrCreate([
$hashtag = Hashtag::updateOrCreate([
'slug' => str_slug($name, '-', false),
],[
],[
'name' => $name
]);
}