chore: Remove redundant roleId from user serializer
This commit is contained in:
@@ -9,7 +9,6 @@ const userSerializer = (user) => {
|
|||||||
createdAt: user.createdAt,
|
createdAt: user.createdAt,
|
||||||
updatedAt: user.updatedAt,
|
updatedAt: user.updatedAt,
|
||||||
fullName: user.fullName,
|
fullName: user.fullName,
|
||||||
roleId: user.roleId,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (user.role) {
|
if (user.role) {
|
||||||
|
@@ -33,7 +33,6 @@ describe('userSerializer', () => {
|
|||||||
email: user.email,
|
email: user.email,
|
||||||
fullName: user.fullName,
|
fullName: user.fullName,
|
||||||
id: user.id,
|
id: user.id,
|
||||||
roleId: user.roleId,
|
|
||||||
updatedAt: user.updatedAt,
|
updatedAt: user.updatedAt,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -15,7 +15,6 @@ const getCurrentUserMock = (currentUser, role) => {
|
|||||||
name: role.name,
|
name: role.name,
|
||||||
updatedAt: role.updatedAt.toISOString(),
|
updatedAt: role.updatedAt.toISOString(),
|
||||||
},
|
},
|
||||||
roleId: role.id,
|
|
||||||
trialExpiryDate: currentUser.trialExpiryDate.toISOString(),
|
trialExpiryDate: currentUser.trialExpiryDate.toISOString(),
|
||||||
updatedAt: currentUser.updatedAt.toISOString(),
|
updatedAt: currentUser.updatedAt.toISOString(),
|
||||||
},
|
},
|
||||||
|
@@ -14,7 +14,6 @@ const getUserMock = (currentUser, role) => {
|
|||||||
name: role.name,
|
name: role.name,
|
||||||
updatedAt: role.updatedAt.toISOString(),
|
updatedAt: role.updatedAt.toISOString(),
|
||||||
},
|
},
|
||||||
roleId: role.id,
|
|
||||||
trialExpiryDate: currentUser.trialExpiryDate.toISOString(),
|
trialExpiryDate: currentUser.trialExpiryDate.toISOString(),
|
||||||
updatedAt: currentUser.updatedAt.toISOString(),
|
updatedAt: currentUser.updatedAt.toISOString(),
|
||||||
},
|
},
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
const getUsersMock = async (users, roles) => {
|
const getUsersMock = async (users, roles) => {
|
||||||
const data = users.map((user) => {
|
const data = users.map((user) => {
|
||||||
const role = roles.find((r) => r.id === user.roleId);
|
const role = roles.find((r) => r.id === user.roleId);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
createdAt: user.createdAt.toISOString(),
|
createdAt: user.createdAt.toISOString(),
|
||||||
email: user.email,
|
email: user.email,
|
||||||
@@ -16,8 +17,7 @@ const getUsersMock = async (users, roles) => {
|
|||||||
name: role.name,
|
name: role.name,
|
||||||
updatedAt: role.updatedAt.toISOString(),
|
updatedAt: role.updatedAt.toISOString(),
|
||||||
}
|
}
|
||||||
: null, // Fallback to null if role not found
|
: null,
|
||||||
roleId: user.roleId,
|
|
||||||
trialExpiryDate: user.trialExpiryDate.toISOString(),
|
trialExpiryDate: user.trialExpiryDate.toISOString(),
|
||||||
updatedAt: user.updatedAt.toISOString(),
|
updatedAt: user.updatedAt.toISOString(),
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user