jargonsdev / jargons.dev

A community-driven dictionary that simplifies software, engineering and tech terms for all levels.
https://jargons.dev
GNU General Public License v2.0
24 stars 8 forks source link

TODO: Handle Error for Existing Branch on Word Submission #52

Open babblebey opened 6 months ago

babblebey commented 6 months ago

When a user submits a new word or edits an existing word in the dictionary, the system should check if the branch already exists before attempting to create a new branch. Currently, if a branch with the same name already exists, the submission process fails without providing a clear error message to the user.

https://github.com/babblebey/jargons.dev/blob/0eeb366b4346c28a400586082fadb331c0ee342f/src/lib/branch.js#L10

Proposed Solution:

  1. Add a check in the submission process to verify if the branch already exists. (but this will assume that a fork has already been created before-hand)
  2. If the branch exists, display a user-friendly error message indicating that the word already exists in the dictionary.
  3. Provide guidance on how to proceed, such as editing the existing word instead of creating a new one.

Additional Notes: