refactor(typing): create interfaces to ensure strongly typed form data
This commit is contained in:
		
							parent
							
								
									9bf5e9dc38
								
							
						
					
					
						commit
						972e8fa646
					
				
							
								
								
									
										26
									
								
								lib/client/types/form/favSub.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								lib/client/types/form/favSub.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,26 @@ | |||||||
|  | interface SubBody { | ||||||
|  | 	stories: number[]; | ||||||
|  | 	authors: number[]; | ||||||
|  | 	bands: number[]; | ||||||
|  | } | ||||||
|  | interface FavBody { | ||||||
|  | 	stories: number[]; | ||||||
|  | 	authors: number[]; | ||||||
|  | } | ||||||
|  | interface HideBody { | ||||||
|  | 	authors: number[]; | ||||||
|  | 	bands: number[]; | ||||||
|  | } | ||||||
|  | export interface SubPayload { | ||||||
|  | 	push: SubBody; | ||||||
|  | 	pull: SubBody; | ||||||
|  | } | ||||||
|  | export interface FavPayload { | ||||||
|  | 	push: FavBody; | ||||||
|  | 	pull: FavBody; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | export interface HidePayload { | ||||||
|  | 	push: HideBody; | ||||||
|  | 	pull: HideBody; | ||||||
|  | } | ||||||
							
								
								
									
										21
									
								
								lib/client/types/form/myStuff.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								lib/client/types/form/myStuff.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,21 @@ | |||||||
|  | export interface MyStuff { | ||||||
|  | 	email?: string; | ||||||
|  | 	password?: string; | ||||||
|  | 	newPassword?: string; | ||||||
|  | 	username?: string; | ||||||
|  | 	disclaimer?: string; | ||||||
|  | 	hidden?: boolean; | ||||||
|  | 	nightMode?: boolean; | ||||||
|  | 	reviewReply?: boolean; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | export interface Profile { | ||||||
|  | 	occupation?: string; | ||||||
|  | 	location?: string; | ||||||
|  | 	website?: string; | ||||||
|  | 	blog?: string; | ||||||
|  | 	bio?: string; | ||||||
|  | 	showEmail?: boolean; | ||||||
|  | 	signature?: string; | ||||||
|  | 	avatar?: string; | ||||||
|  | } | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user