-
Notifications
You must be signed in to change notification settings - Fork 13
refactor: nest role fields in UserProjectMembership API response #1096
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
bf08d8a
c60c2a7
78b10a0
a55dbdc
727652f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,19 @@ | ||
| import { Role } from './role' | ||
| import { UserPermission } from 'utils/user/types' | ||
|
|
||
| export type ServerMember = any // TODO: Update this type | ||
| export type ServerMember = { | ||
| created_at: string | ||
| id: string | ||
| role: Role | null | ||
| updated_at: string | ||
|
mihow marked this conversation as resolved.
|
||
| user: { | ||
| id: string | ||
| name: string | ||
| email: string | ||
| image?: string | ||
| } | ||
| user_permissions: UserPermission[] | ||
| } | ||
|
|
||
| export type Member = { | ||
| addedAt: Date | ||
|
|
@@ -10,7 +23,7 @@ export type Member = { | |
| id: string | ||
| image?: string | ||
| name: string | ||
| role: Role | ||
| role: Role | null | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we not assume a member will have a role?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It doesn't make logical sense in the application, but its technically possible since roles & project membership are maintained in two different systems (roles are built on the Django permission system, membership is our own system). One option could be to filter the members on the API side - only return ones that have a valid role. |
||
| updatedAt?: Date | ||
| userId: string | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| export type Role = { | ||
| name: string | ||
| id: string | ||
| description?: string | ||
| description: string | ||
|
mihow marked this conversation as resolved.
|
||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.