- Linting... Prettier...
This commit is contained in:
@@ -1,44 +1,48 @@
|
||||
import { List, Record } from 'immutable';
|
||||
|
||||
export default class Profile extends Record({
|
||||
addresses: new List(),
|
||||
avatar: null,
|
||||
email: null,
|
||||
firstName: null,
|
||||
generatedNomDeBid: false,
|
||||
hasLinkedApple: false,
|
||||
hasLinkedFacebook: false,
|
||||
hasLinkedGoogle: false,
|
||||
hasLocalAccount: false,
|
||||
id: null,
|
||||
isAllowedToBid: false,
|
||||
isOrganizationEmployee: false,
|
||||
isVerified: false,
|
||||
lastName: null,
|
||||
nomDeBid: null,
|
||||
organizationIdentifier: null,
|
||||
paymentToken: null,
|
||||
phones: new List(),
|
||||
addresses: new List(),
|
||||
avatar: null,
|
||||
email: null,
|
||||
firstName: null,
|
||||
generatedNomDeBid: false,
|
||||
hasLinkedApple: false,
|
||||
hasLinkedFacebook: false,
|
||||
hasLinkedGoogle: false,
|
||||
hasLocalAccount: false,
|
||||
id: null,
|
||||
isAllowedToBid: false,
|
||||
isOrganizationEmployee: false,
|
||||
isVerified: false,
|
||||
lastName: null,
|
||||
nomDeBid: null,
|
||||
organizationIdentifier: null,
|
||||
paymentToken: null,
|
||||
phones: new List(),
|
||||
}) {
|
||||
get canBid() {
|
||||
return this.isAllowedToBid && this.paymentToken !== null;
|
||||
}
|
||||
get canBid() {
|
||||
return this.isAllowedToBid && this.paymentToken !== null;
|
||||
}
|
||||
|
||||
get fullName() {
|
||||
return `${this.firstName} ${this.lastName}`;
|
||||
}
|
||||
get fullName() {
|
||||
return `${this.firstName} ${this.lastName}`;
|
||||
}
|
||||
|
||||
get isRegisteredAccount() {
|
||||
return this.hasLinkedApple ||
|
||||
this.hasLinkedFacebook || this.hasLinkedGoogle || this.hasLocalAccount;
|
||||
}
|
||||
get isRegisteredAccount() {
|
||||
return (
|
||||
this.hasLinkedApple ||
|
||||
this.hasLinkedFacebook ||
|
||||
this.hasLinkedGoogle ||
|
||||
this.hasLocalAccount
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Profile.fromJS = (data = {}) => {
|
||||
return new Profile({
|
||||
id: data._id,
|
||||
...data,
|
||||
addresses: new List(data.addresses),
|
||||
phones: new List(data.phones),
|
||||
});
|
||||
return new Profile({
|
||||
id: data._id,
|
||||
...data,
|
||||
addresses: new List(data.addresses),
|
||||
phones: new List(data.phones),
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user