Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to attach a Particular tag to a question - it getting override to different TAG #888

Closed
surapuramakhil opened this issue Apr 1, 2024 · 5 comments · Fixed by #923
Assignees
Labels
bug Something isn't working
Milestone

Comments

@surapuramakhil
Copy link
Contributor

surapuramakhil commented Apr 1, 2024

Describe the bug

Check video

REC-20240401054037.mp4

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots or video to help explain your problem.

Platform

  • Device: [e.g. Desktop, Mobile]
  • OS: [e.g. macOS]
  • Browser and version: [e.g. Chrome, Safari]
  • Version: [e.g. v1.2.0]
@surapuramakhil surapuramakhil added the bug Something isn't working label Apr 1, 2024
@LinkinStars
Copy link
Member

@surapuramakhil Thanks for feedback. This is may because did not format the slug name when updating the tags. PUT /tag API. Regular the tag slug name should not have spaces, and spaces will be replaced with a hyphen.

@LinkinStars LinkinStars added this to the v1.3.1 milestone Apr 2, 2024
@surapuramakhil
Copy link
Contributor Author

Ah, It's interesting. I checked slug data of these tags. Surprised, only this slug has spaces instead of -. Wondering why had happened.

Thanks, @LinkinStars. Based on information provided, I was able to clean up tags and the issue has been fixed after cleanup.

@prithvidasgupta
Copy link
Contributor

Hello I would like to take a crack at this bug. @LinkinStars what would be the ideal behaviour in this case?

@LinkinStars
Copy link
Member

Hello I would like to take a crack at this bug. @LinkinStars what would be the ideal behaviour in this case?

@prithvidasgupta Good. Let me describe the problem indetail.

In /tag POST API service, the one used to add a tag, you can see that there is formatting for the tag's slug_name.

SlugName := strings.ReplaceAll(req.SlugName, " ", "-")
SlugName = strings.ToLower(SlugName)

In /tag PUT API service, the one used to update the tag, you can see that there is no formatting.

func (ts *TagCommonService) UpdateTag(ctx context.Context, req *schema.UpdateTagReq) (err error) {

So, just add the same formatting code to the PUT API service.

BTW, the SlugName should be slugName. You can fix the typo at the same time.

@prithvidasgupta
Copy link
Contributor

@LinkinStars #923 should be the exact code change as you suggested. I tested it by running the build locally but I am not sure where to add the unit-tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants