Skip to content
This repository has been archived by the owner on Sep 22, 2022. It is now read-only.

fix: allow different shops to have same tag name #30

Merged
merged 2 commits into from
Aug 18, 2021

Conversation

MohanNarayana
Copy link
Contributor

Signed-off-by: Mohan Narayana [email protected]

Resolves #28
Impact: minor
Type: bugfix

Issue

The problem is that Tag's slug is unique across the whole system. For system where there can be multiple shops it doesn't look like a good solution since it's a very common case to have same tags in different shops

Solution

Make slug and shopId index pair value to be unique.

Testing

  1. Set up api-migrations using these steps. NOTE: Use node 14 at step 3. Copy the new api-plugin-tags to api-migrations/node_modules/@reactioncommerce.
  2. Add below code to api-migrations/migrator.config.js
    { namespace: "tags", package: "@reactioncommerce/api-plugin-tags", version: 2 }
  3. Run MONGO_URL=mongodb://localhost:27017/reaction npx migrator migrate
  4. Check DB for index 'slug_1' in the tags table.

@MohanNarayana MohanNarayana requested a review from a team August 17, 2021 21:47
Signed-off-by: Mohan Narayana <[email protected]>
@MohanNarayana MohanNarayana merged commit fe93538 into trunk Aug 18, 2021
@rc-publisher
Copy link
Collaborator

🎉 This PR is included in version 1.1.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@rc-publisher rc-publisher added the released Applied automatically by semantic-release label Aug 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
released Applied automatically by semantic-release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

It's impossible to create tags with same names in different shops
3 participants