mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-29 05:00:43 +10:00
Camel case current-user
This commit is contained in:
parent
03b576d8c4
commit
9384638e2d
6 changed files with 6 additions and 6 deletions
|
|
@ -17,7 +17,7 @@ describe('CheckoutPage', () => {
|
|||
history: { push: noop },
|
||||
intl: fakeIntl,
|
||||
listing,
|
||||
currentUser: createCurrentUser('current-user'),
|
||||
currentUser: createCurrentUser('currentUser'),
|
||||
params: { id: 'listing1', slug: 'listing1' },
|
||||
sendOrderRequest: noop,
|
||||
fetchSpeculatedTransaction: noop,
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ export const updateProfile = actionPayload => {
|
|||
// Include profile image to denormalized user entity
|
||||
const currentUserId = response.data.data.id;
|
||||
const entities = updatedEntities({}, response.data);
|
||||
const denormalised = denormalisedEntities(entities, 'current-user', [currentUserId]);
|
||||
const denormalised = denormalisedEntities(entities, 'currentUser', [currentUserId]);
|
||||
const currentUser = denormalised[0];
|
||||
|
||||
// Update current user in state.user.currentUser through user.duck.js
|
||||
|
|
|
|||
|
|
@ -341,7 +341,7 @@ export const fetchCurrentUser = () => (dispatch, getState, sdk) => {
|
|||
// Include profile image to denormalized user entity
|
||||
const currentUserId = response.data.data.id;
|
||||
const entities = updatedEntities({}, response.data);
|
||||
const denormalised = denormalisedEntities(entities, 'current-user', [currentUserId]);
|
||||
const denormalised = denormalisedEntities(entities, 'currentUser', [currentUserId]);
|
||||
const currentUser = denormalised[0];
|
||||
// set current user id to the logger
|
||||
log.setUserId(currentUser.id.uuid);
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ export const ensureUser = user => {
|
|||
* @param {Object} current user entity object, which is to be ensured agains null values
|
||||
*/
|
||||
export const ensureCurrentUser = user => {
|
||||
const empty = { id: null, type: 'current-user', attributes: { profile: {} }, profileImage: {} };
|
||||
const empty = { id: null, type: 'currentUser', attributes: { profile: {} }, profileImage: {} };
|
||||
return { ...empty, ...user };
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ export const place = shape({
|
|||
// Denormalised user object
|
||||
export const currentUser = shape({
|
||||
id: uuid.isRequired,
|
||||
type: value('current-user').isRequired,
|
||||
type: value('currentUser').isRequired,
|
||||
attributes: shape({
|
||||
banned: bool.isRequired,
|
||||
email: string.isRequired,
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ export const createUser = id => ({
|
|||
// Create a user that conforms to the util/propTypes currentUser schema
|
||||
export const createCurrentUser = id => ({
|
||||
id: new UUID(id),
|
||||
type: 'current-user',
|
||||
type: 'currentUser',
|
||||
attributes: {
|
||||
banned: false,
|
||||
email: `${id}@example.com`,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue