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

#1799 - Rattachement manuel d'utilisateur à une agence (admin) #2128

Conversation

clement-duport
Copy link
Contributor

  • reorganise test
  • WIP

Copy link

@celineung celineung marked this pull request as draft August 29, 2024 14:27
@clement-duport clement-duport force-pushed the 1799-rattacher-manuellement-un-utilisateur-ic-ou-non-ic--une-agence-en-tant-quadmin-if branch from d63619d to 87e9f7b Compare September 2, 2024 14:03
@celineung celineung force-pushed the 1799-rattacher-manuellement-un-utilisateur-ic-ou-non-ic--une-agence-en-tant-quadmin-if branch from 87e9f7b to 7716ad2 Compare September 2, 2024 15:33
@clement-duport clement-duport force-pushed the 1799-rattacher-manuellement-un-utilisateur-ic-ou-non-ic--une-agence-en-tant-quadmin-if branch 2 times, most recently from 75bd26a to dcc506b Compare September 4, 2024 09:57
@celineung celineung force-pushed the 1799-rattacher-manuellement-un-utilisateur-ic-ou-non-ic--une-agence-en-tant-quadmin-if branch from ae8de84 to a188be3 Compare September 4, 2024 16:29
@clement-duport clement-duport marked this pull request as ready for review September 5, 2024 08:27
@celineung celineung changed the title 1799 rattacher manuellement un utilisateur ic ou non ic une agence en tant quadmin if #1799 - rattacher manuellement un utilisateur ic ou non ic une agence en tant quadmin if Sep 5, 2024
@clement-duport clement-duport force-pushed the 1799-rattacher-manuellement-un-utilisateur-ic-ou-non-ic--une-agence-en-tant-quadmin-if branch from 0d90410 to 888b83c Compare September 5, 2024 12:44
@clement-duport clement-duport changed the title #1799 - rattacher manuellement un utilisateur ic ou non ic une agence en tant quadmin if #1799 - rattacher manuellement un utilisateur ic ou non ic une agence en tant qu'admin if Sep 5, 2024
@enguerranws enguerranws changed the title #1799 - rattacher manuellement un utilisateur ic ou non ic une agence en tant qu'admin if #1799 - Rattachement manuel d'utilisateur à une agence (admin) Sep 5, 2024
inputSchema: userParamsForAgencySchema,
},
async ({ inputParams, uow, currentUser, deps }) => {
throwIfNotAdmin(currentUser);
Copy link
Collaborator

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

Copy link
Contributor

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

Comment on lines 136 to 164
({
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,
}),
Copy link
Collaborator

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 :

Suggested change
({
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,
}),

@celineung celineung force-pushed the 1799-rattacher-manuellement-un-utilisateur-ic-ou-non-ic--une-agence-en-tant-quadmin-if branch from 888b83c to baf1f52 Compare September 9, 2024 13:20
@celineung celineung force-pushed the 1799-rattacher-manuellement-un-utilisateur-ic-ou-non-ic--une-agence-en-tant-quadmin-if branch from baf1f52 to 6aa6c32 Compare September 9, 2024 13:22
@celineung celineung enabled auto-merge (rebase) September 9, 2024 13:22
@celineung celineung merged commit d302268 into main Sep 9, 2024
11 of 12 checks passed
@celineung celineung deleted the 1799-rattacher-manuellement-un-utilisateur-ic-ou-non-ic--une-agence-en-tant-quadmin-if branch September 9, 2024 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rattacher manuellement un utilisateur IC ou non IC à une agence en tant qu'admin IF
3 participants