mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-14 00:24:07 -08:00
return role from POST /invitations
This makes sure the role is in the user store in the frontend without the FE needing to do manual remapping.
This commit is contained in:
parent
f98f0ead25
commit
a6565d3cbf
|
@ -244,7 +244,13 @@ export declare namespace UserRequest {
|
|||
>;
|
||||
|
||||
export type InviteResponse = {
|
||||
user: { id: string; email: string; inviteAcceptUrl?: string; emailSent: boolean };
|
||||
user: {
|
||||
id: string;
|
||||
email: string;
|
||||
inviteAcceptUrl?: string;
|
||||
emailSent: boolean;
|
||||
role: AssignableRole;
|
||||
};
|
||||
error?: string;
|
||||
};
|
||||
|
||||
|
|
|
@ -130,6 +130,7 @@ export class UserService {
|
|||
email,
|
||||
inviteAcceptUrl,
|
||||
emailSent: false,
|
||||
role,
|
||||
},
|
||||
error: '',
|
||||
};
|
||||
|
|
|
@ -246,6 +246,7 @@ describe('InvitationController', () => {
|
|||
const { user } = response.body.data[0];
|
||||
|
||||
expect(user.inviteAcceptUrl).toBeDefined();
|
||||
expect(user).toHaveProperty('role', 'global:member');
|
||||
|
||||
const inviteUrl = new URL(user.inviteAcceptUrl);
|
||||
|
||||
|
|
Loading…
Reference in a new issue