Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: Include default workspace of user in getSelf function #365

Closed
rajdip-b opened this issue Jul 19, 2024 · 10 comments · Fixed by #414
Closed

API: Include default workspace of user in getSelf function #365

rajdip-b opened this issue Jul 19, 2024 · 10 comments · Fixed by #414
Assignees
Labels
difficulty: 1 foss hack Clustering all the curated issues for Foss Hack 2024 good first issue Good for newcomers priority: low released scope: api Everything related to the API type: enhancement New feature or request

Comments

@rajdip-b
Copy link
Member

Description

When we call GET /api/user/, we are responded with the details of the user. We would also like to include the details of the default workspace of the user.

Solution

The update would be scoped to this block:

async getSelf(user: User) {
return user
}

  • Add a field called defaultWorkspace and include the details in there.
  • Update the tests accordingly to reflect this change in user.e2e.spec.ts
@rajdip-b rajdip-b added type: enhancement New feature or request good first issue Good for newcomers scope: api Everything related to the API priority: low foss hack Clustering all the curated issues for Foss Hack 2024 difficulty: 1 labels Jul 19, 2024
@rajdip-b rajdip-b moved this to Todo in keyshade-api Jul 19, 2024
@anjali2004arya
Copy link

/attempt

Copy link

Assigned the issue to @anjali2004arya!

@rajdip-b rajdip-b moved this from Todo to In progress in keyshade-api Jul 23, 2024
@rajdip-b
Copy link
Member Author

rajdip-b commented Aug 3, 2024

@anjali2004arya any progress on this?

@rajdip-b rajdip-b moved this from In progress to Todo in keyshade-api Sep 4, 2024
@rajdip-b
Copy link
Member Author

rajdip-b commented Sep 4, 2024

Removed assignment because of inactivity. Please feel free to pick it up in case you want to.

@unamdev0
Copy link
Contributor

unamdev0 commented Sep 5, 2024

@rajdip-b can you please clarify how to find which workspace is the default workspace of a user? In case user is added to just one workspace we can return that, but in case user is part of multiple workspaces, how do we decide which one is the default one?

@rajdip-b
Copy link
Member Author

rajdip-b commented Sep 5, 2024

Hi! By default, when a user is created, a default workspace gets created for them. Every workspace has a isDefault and ownerId field. So in your case, you would need to find the workspace that has isDefaul= true and ownerId = user ID. Hope that makes sense.

@unamdev0
Copy link
Contributor

unamdev0 commented Sep 5, 2024

Oh ok, got it thanks!!

@unamdev0
Copy link
Contributor

unamdev0 commented Sep 7, 2024

/attempt

Copy link

github-actions bot commented Sep 7, 2024

Assigned the issue to @unamdev0!

@rajdip-b rajdip-b moved this from Todo to In progress in keyshade-api Sep 7, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in keyshade-api Sep 9, 2024
@rajdip-b rajdip-b moved this from Done to Queued for release in keyshade-api Sep 9, 2024
@rajdip-b
Copy link
Member Author

🎉 This issue has been resolved in version 2.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: 1 foss hack Clustering all the curated issues for Foss Hack 2024 good first issue Good for newcomers priority: low released scope: api Everything related to the API type: enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants