Many fix and improvements
This commit is contained in:
@@ -1,48 +0,0 @@
|
||||
import UserTransactionsModel from "@/models/userTransactionsModel.js";
|
||||
import SocialNetworksModel from "@/models/socialNetworksModel.js";
|
||||
import ProfileColorsModel from "@/models/profileColorsModel.js";
|
||||
import StoredDataUrlsModel from "@/models/storedDataUrlsModel.js";
|
||||
|
||||
export default class MyUserModel
|
||||
{
|
||||
id = "";
|
||||
creatorAlias = "";
|
||||
alias = null;
|
||||
firstName = "";
|
||||
lastName = "";
|
||||
userName = "";
|
||||
occupation = "";
|
||||
email = "";
|
||||
phoneNumber = "";
|
||||
birthDate = "";
|
||||
country = "";
|
||||
city = "";
|
||||
address = "";
|
||||
about = "";
|
||||
description = "";
|
||||
socialNetworks = new SocialNetworksModel();
|
||||
profileColors = new ProfileColorsModel();
|
||||
storedDataUrls = new StoredDataUrlsModel();
|
||||
totalBalance = "";
|
||||
userTransactions = [];
|
||||
|
||||
static createFromApiResult(apiResult){
|
||||
const userModel = Object.assign(new MyUserModel(), apiResult);
|
||||
|
||||
const notMapperTransaction = Object.freeze(userModel.userTransactions);
|
||||
userModel.userTransactions = [];
|
||||
|
||||
for (const transaction of notMapperTransaction) {
|
||||
userModel.userTransactions.push(UserTransactionsModel.createFromApiResult(transaction))
|
||||
}
|
||||
|
||||
return userModel;
|
||||
}
|
||||
|
||||
static getDefaultUser(){
|
||||
const defaultUser = new MyUserModel();
|
||||
defaultUser.userName = "Anonyme"
|
||||
|
||||
return defaultUser;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
export default class ProfileColorsModel
|
||||
{
|
||||
bannerTop = "";
|
||||
bannerBottom = "";
|
||||
accent = "";
|
||||
menu = "";
|
||||
|
||||
static createFromApiResult(apiResult){
|
||||
return Object.assign(new ProfileColorsModel(), apiResult)
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
export default class SocialNetworksModel
|
||||
{
|
||||
facebookUrl = "";
|
||||
instagramUrl = "";
|
||||
xUrl = "";
|
||||
linkedInUrl = "";
|
||||
tikTokUrl = "";
|
||||
youtubeUrl = "";
|
||||
redditUrl = "";
|
||||
yourWebsiteUrl = "";
|
||||
|
||||
static createFromApiResult(apiResult){
|
||||
return Object.assign(new SocialNetworksModel(), apiResult)
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
export default class StoredDataUrlsModel
|
||||
{
|
||||
bannerPictureUrl = null;
|
||||
profilePictureUrl = null;
|
||||
websiteIconUrl = null;
|
||||
|
||||
static createFromApiResult(apiResult){
|
||||
return Object.assign(new StoredDataUrlsModel(), apiResult)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user