General cleanup: fix some bugs, some refactoring (#65)

* Merged mod file upload in version creation, mod creation and
  version file add to one function;  This makes sure that they are
  consistent
* Made some fields on `User` optional: `github_id`, `avatar_url`, `bio`.
    * We may not want to publicly show the `github_id` to everyone
      with access to the API
    * If we allow non-github users, some of those fields would be
      invalid; some oauth providers may not have avatars or bios
* Made CORS origins should configurable
* Made `--reconfigure-indices` and `--reset-indices` exit after
  completion instead of starting the server
This commit is contained in:
Aeledfyr
2020-10-01 00:07:52 -05:00
committed by GitHub
parent 43a791db65
commit c4fb7b7928
16 changed files with 318 additions and 561 deletions

View File

@@ -58,7 +58,7 @@ where
match res {
Some(result) => Ok(User {
id: UserId::from(result.id),
github_id: result.github_id as u64,
github_id: result.github_id.map(|i| i as u64),
username: result.username,
name: result.name,
email: result.email,