-
Notifications
You must be signed in to change notification settings - Fork 4
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
#1799 - Rattachement manuel d'utilisateur à une agence (admin) #2128
#1799 - Rattachement manuel d'utilisateur à une agence (admin) #2128
Conversation
clement-duport
commented
Aug 27, 2024
- reorganise test
- WIP
Review app: |
d63619d
to
87e9f7b
Compare
87e9f7b
to
7716ad2
Compare
75bd26a
to
dcc506b
Compare
ae8de84
to
a188be3
Compare
0d90410
to
888b83c
Compare
inputSchema: userParamsForAgencySchema, | ||
}, | ||
async ({ inputParams, uow, currentUser, deps }) => { | ||
throwIfNotAdmin(currentUser); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
je crois bien qu'il faut await
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Il n'y a pas d'appels asynchrones.
On fait juste des vérifications de props.
Donc pas besoin de await
({ | ||
id, | ||
email, | ||
firstName, | ||
lastName, | ||
createdAt, | ||
dashboards, | ||
externalId, | ||
agencyRights, | ||
}) => | ||
icUsersAdminSlice.actions.createUserOnAgencySucceeded({ | ||
icUser: { | ||
id, | ||
email, | ||
firstName, | ||
lastName, | ||
externalId, | ||
createdAt, | ||
dashboards, | ||
agencyRights: agencyRights.reduce( | ||
(agenciesAcc, agencyRight) => ({ | ||
...agenciesAcc, | ||
[agencyRight.agency.id]: agencyRight, | ||
}), | ||
{} as Record<AgencyId, AgencyRight>, | ||
), | ||
}, | ||
feedbackTopic: action.payload.feedbackTopic, | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on peut peut-être alleger un peu l'écriture :
({ | |
id, | |
email, | |
firstName, | |
lastName, | |
createdAt, | |
dashboards, | |
externalId, | |
agencyRights, | |
}) => | |
icUsersAdminSlice.actions.createUserOnAgencySucceeded({ | |
icUser: { | |
id, | |
email, | |
firstName, | |
lastName, | |
externalId, | |
createdAt, | |
dashboards, | |
agencyRights: agencyRights.reduce( | |
(agenciesAcc, agencyRight) => ({ | |
...agenciesAcc, | |
[agencyRight.agency.id]: agencyRight, | |
}), | |
{} as Record<AgencyId, AgencyRight>, | |
), | |
}, | |
feedbackTopic: action.payload.feedbackTopic, | |
}), | |
(user) => | |
icUsersAdminSlice.actions.createUserOnAgencySucceeded({ | |
icUser: { | |
...user, | |
agencyRights: user.agencyRights.reduce( | |
(agenciesAcc, agencyRight) => ({ | |
...agenciesAcc, | |
[agencyRight.agency.id]: agencyRight, | |
}), | |
{} as Record<AgencyId, AgencyRight>, | |
), | |
}, | |
feedbackTopic: action.payload.feedbackTopic, | |
}), |
888b83c
to
baf1f52
Compare
Co-authored-by: Celine Ung <[email protected]>
baf1f52
to
6aa6c32
Compare