1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-25 17:26:43 +00:00

Merge pull request #4669 from pixelfed/staging

Update StatusTagsPipeline, fix object tags slug query
This commit is contained in:
daniel 2023-09-25 05:14:22 -06:00 committed by GitHub
commit dcc6f65e33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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