Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Mastodon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Mastodon
Commits
51a33ce7
Unverified
Commit
51a33ce7
authored
2 years ago
by
Claire
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix not being able to follow more than one hashtag (#21285)
Fixes regression from #20860
parent
69378eac
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/controllers/api/v1/tags_controller.rb
+1
-1
1 addition, 1 deletion
app/controllers/api/v1/tags_controller.rb
spec/controllers/api/v1/tags_controller_spec.rb
+4
-0
4 additions, 0 deletions
spec/controllers/api/v1/tags_controller_spec.rb
with
5 additions
and
1 deletion
app/controllers/api/v1/tags_controller.rb
+
1
−
1
View file @
51a33ce7
...
...
@@ -12,7 +12,7 @@ class Api::V1::TagsController < Api::BaseController
end
def
follow
TagFollow
.
first
_or_create!
(
tag:
@tag
,
account:
current_account
,
rate_limit:
true
)
TagFollow
.
create_with
(
rate_limit:
true
).
find
_or_create
_by
!
(
tag:
@tag
,
account:
current_account
)
render
json:
@tag
,
serializer:
REST
::
TagSerializer
end
...
...
This diff is collapsed.
Click to expand it.
spec/controllers/api/v1/tags_controller_spec.rb
+
4
−
0
View file @
51a33ce7
...
...
@@ -33,7 +33,11 @@ RSpec.describe Api::V1::TagsController, type: :controller do
end
describe
'POST #follow'
do
let!
(
:unrelated_tag
)
{
Fabricate
(
:tag
)
}
before
do
TagFollow
.
create!
(
account:
user
.
account
,
tag:
unrelated_tag
)
post
:follow
,
params:
{
id:
name
}
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment