refr(enso/cloud-v2#912): Rename SimpleUser.id to SimpleUser.userSubject (#9490)

This PR updates the model types for the request/response bodies to match the backend.

These changes are for the (yet to be merged) changes to the `User` types:
- https://github.com/enso-org/cloud-v2/pull/1075

Note that this PR must be **merged after the above PRs have been merged and deployed** to the backend.

- Rename `SimpleUser::id` to `SimpleUser::userSubject` to match the backend

# Important Notes
On the backend, `SimpleUser.id` has been renamed to `SimpleUser.userSubject` for consistency.  This commit updates the frontend to account for this change.
This commit is contained in:
Nikita Pekin 2024-03-20 20:48:29 +02:00 committed by GitHub
parent ecd56bbba8
commit 4ed970d9d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

View File

@ -156,7 +156,7 @@ export default function ManagePermissionsModal<
/* eslint-disable @typescript-eslint/naming-convention */
pk: newUser.organizationId,
sk: newUser.userId,
user_subject: newUser.id,
user_subject: newUser.userSubject,
user_email: newUser.email,
user_name: newUser.name,
/* eslint-enable @typescript-eslint/naming-convention */
@ -295,7 +295,7 @@ export default function ManagePermissionsModal<
values={users}
setValues={setUsers}
items={allUsers}
itemToKey={otherUser => otherUser.id}
itemToKey={otherUser => otherUser.userSubject}
itemToString={otherUser => `${otherUser.name} (${otherUser.email})`}
matches={(otherUser, text) =>
otherUser.email.toLowerCase().includes(text.toLowerCase()) ||

View File

@ -408,7 +408,7 @@ export interface OrganizationInfo {
export interface SimpleUser {
readonly organizationId: OrganizationId
readonly userId: UserId
readonly id: Subject
readonly userSubject: Subject
readonly name: string
readonly email: EmailAddress
}

View File

@ -235,7 +235,7 @@ export function tryGetSingletonOwnerPermission(
/* eslint-disable @typescript-eslint/naming-convention */
pk: owner.id,
sk: backend.UserId(''),
user_subject: user?.id ?? backend.Subject(''),
user_subject: user?.userSubject ?? backend.Subject(''),
user_email: owner.email,
user_name: owner.name,
/* eslint-enable @typescript-eslint/naming-convention */