Skip to content

Project Snippet deletion redirects to wrong path

Summary

When you delete a project snippet, you are redirected to /dashboard/snippets, but I would expect to be redirected to the project snippets dashboard again, e.g. /test-project/snippets

Steps to reproduce

  • Create a snippet for a project
  • Navigate to that snippet 'show' view
  • Delete snippet
  • Be redirected to /dashboard/snippets

What is the current bug behavior?

User redirected to /dashboard/snippets

What is the expected correct behavior?

User is redirected to /project-namespace/snippets

Possible fixes

I believe this line: https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/assets/javascripts/snippets/components/snippet_header.vue#L122

Needs to change to cater for project or personal snippet paths.