hack-rpi / Status-Board

Hackathon commit messages, announcements, mentor requests, and more, all in one place!
https://status.hackrpi.com
MIT License
14 stars 5 forks source link

Unable to add multiple repositories with the same name #31

Closed mpoegel closed 9 years ago

mpoegel commented 9 years ago

As evident below, the check to see if a repository already exists in the database is done by name, thus preventing different repositories of the same name to be added. Find some unique identifier or pair with the owner or something.

Lines 216-229 of client/user.js:

    else if (repo_add_repo_name && repo_add_handle) {
      var repo_doc = RepositoryList.findOne({ "name":repo_add_repo_name });
      if (repo_doc) {
        // found repository in the database so just connect the current user
        $("#join-repo-modal").modal("hide");
        linkUserToRepo(repo_add_handle, repo_doc);
      }
      else {
        // existing repository not found
        add_new_repo_flag = true;
        add_new_repo_dep.changed();
        return false;
      }
    }
mpoegel commented 9 years ago

Should be fixed with 056626f14df8f9df3f88fb8ad481f8aa7e767286.

It now prompts for the repository URL and queries by the full name of the repository: 'owner/repository_name'.