export default {
  group: 'specific',
  fn: ({ to, from, router }) => {
    const { content } = to.params

    if (content === 'franchised_spaces_folders') {
      const space = from.path.replace(/\//, '')
      const { folder } = { ...from.query, ...to.query }

      router.push({
        name: 'AddFranchisedSpacesFolders',
        query: folder ? { space: space, folder: folder } : { space: space }
      })
    }
  }
}
