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

feat(proxy): org project list endpoint #343

Merged
merged 5 commits into from
May 7, 2020
Merged

Conversation

MeBrei
Copy link
Contributor

@MeBrei MeBrei commented May 5, 2020

Endpoint to return all projects registered under an org.

  • filter project list by org id
  • return Project instead of only the project name (*)
  • expose list in the api GET orgs/<id>/projects

(*) Open issue/dependency:

  • when registering a project, currently None is always passed as the maybe_project_id in the proxy. In order to show any other info beside the name of the project, we need to pass the project id.

Solves part of #277

@MeBrei MeBrei added proxy feature Something that doesn't exist yet labels May 5, 2020
@MeBrei MeBrei requested review from xla and rudolfs May 5, 2020 11:29
@MeBrei MeBrei self-assigned this May 5, 2020
@MeBrei MeBrei changed the title Filter projects from registry feat(proxy): org project list endpoint May 5, 2020
@MeBrei
Copy link
Contributor Author

MeBrei commented May 7, 2020

Added an issue in the registry to retrieve the projects of an org/user more direct.

@MeBrei MeBrei marked this pull request as ready for review May 7, 2020 09:57
Copy link
Contributor

@xla xla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two small rusty things, otherwise legit!

😸 😻 ♎️ 🌮

@@ -223,8 +224,18 @@ mod handler {
let fake_fee: Balance = 100;

let mut reg = registry.write().await;
let maybe_coco_id = match input.maybe_coco_id {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to use Option::map to transform the Some value and return None if no value is present.

Project {
name: project.name,
org_id: project.org_id,
maybe_project_id: if let [] = metadata_vec[..] {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The is_empty would make this more readable.

@MeBrei MeBrei mentioned this pull request May 7, 2020
18 tasks
@MeBrei MeBrei merged commit dd3433f into master May 7, 2020
@MeBrei MeBrei deleted the merle/org-project-list branch May 7, 2020 13:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature Something that doesn't exist yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants