mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-28 20:53:24 +10:00
Merge pull request #544 from sharetribe/camel-case-resource-types
Camel case resource types
This commit is contained in:
commit
973ce70118
7 changed files with 7 additions and 7 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,
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@ exports[`ListingPage matches snapshot 1`] = `
|
|||
"id": UUID {
|
||||
"uuid": "user-2",
|
||||
},
|
||||
"type": "current-user",
|
||||
"type": "currentUser",
|
||||
}
|
||||
}
|
||||
rootClassName={null}
|
||||
|
|
|
|||
|
|
@ -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