website refactor
This commit is contained in:
@@ -8,7 +8,7 @@ export class SponsorSettingsViewModel {
|
||||
notifications: NotificationSettingsViewModel;
|
||||
privacy: PrivacySettingsViewModel;
|
||||
|
||||
constructor(data: { profile: any; notifications: any; privacy: any }) {
|
||||
constructor(data: { profile: unknown; notifications: unknown; privacy: unknown }) {
|
||||
this.profile = new SponsorProfileViewModel(data.profile);
|
||||
this.notifications = new NotificationSettingsViewModel(data.notifications);
|
||||
this.privacy = new PrivacySettingsViewModel(data.privacy);
|
||||
@@ -37,18 +37,20 @@ export class SponsorProfileViewModel {
|
||||
instagram: string;
|
||||
};
|
||||
|
||||
constructor(data: any) {
|
||||
this.companyName = data.companyName;
|
||||
this.contactName = data.contactName;
|
||||
this.contactEmail = data.contactEmail;
|
||||
this.contactPhone = data.contactPhone;
|
||||
this.website = data.website;
|
||||
this.description = data.description;
|
||||
this.logoUrl = data.logoUrl;
|
||||
this.industry = data.industry;
|
||||
this.address = data.address;
|
||||
this.taxId = data.taxId;
|
||||
this.socialLinks = data.socialLinks;
|
||||
constructor(data: unknown) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const d = data as any;
|
||||
this.companyName = d.companyName;
|
||||
this.contactName = d.contactName;
|
||||
this.contactEmail = d.contactEmail;
|
||||
this.contactPhone = d.contactPhone;
|
||||
this.website = d.website;
|
||||
this.description = d.description;
|
||||
this.logoUrl = d.logoUrl;
|
||||
this.industry = d.industry;
|
||||
this.address = d.address;
|
||||
this.taxId = d.taxId;
|
||||
this.socialLinks = d.socialLinks;
|
||||
}
|
||||
|
||||
get fullAddress(): string {
|
||||
@@ -64,13 +66,15 @@ export class NotificationSettingsViewModel {
|
||||
emailNewOpportunities: boolean;
|
||||
emailContractExpiry: boolean;
|
||||
|
||||
constructor(data: any) {
|
||||
this.emailNewSponsorships = data.emailNewSponsorships;
|
||||
this.emailWeeklyReport = data.emailWeeklyReport;
|
||||
this.emailRaceAlerts = data.emailRaceAlerts;
|
||||
this.emailPaymentAlerts = data.emailPaymentAlerts;
|
||||
this.emailNewOpportunities = data.emailNewOpportunities;
|
||||
this.emailContractExpiry = data.emailContractExpiry;
|
||||
constructor(data: unknown) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const d = data as any;
|
||||
this.emailNewSponsorships = d.emailNewSponsorships;
|
||||
this.emailWeeklyReport = d.emailWeeklyReport;
|
||||
this.emailRaceAlerts = d.emailRaceAlerts;
|
||||
this.emailPaymentAlerts = d.emailPaymentAlerts;
|
||||
this.emailNewOpportunities = d.emailNewOpportunities;
|
||||
this.emailContractExpiry = d.emailContractExpiry;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,10 +84,12 @@ export class PrivacySettingsViewModel {
|
||||
showActiveSponsorships: boolean;
|
||||
allowDirectContact: boolean;
|
||||
|
||||
constructor(data: any) {
|
||||
this.publicProfile = data.publicProfile;
|
||||
this.showStats = data.showStats;
|
||||
this.showActiveSponsorships = data.showActiveSponsorships;
|
||||
this.allowDirectContact = data.allowDirectContact;
|
||||
constructor(data: unknown) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const d = data as any;
|
||||
this.publicProfile = d.publicProfile;
|
||||
this.showStats = d.showStats;
|
||||
this.showActiveSponsorships = d.showActiveSponsorships;
|
||||
this.allowDirectContact = d.allowDirectContact;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user