refactor(common): User
This commit is contained in:
		
							parent
							
								
									1a0704c16f
								
							
						
					
					
						commit
						3b51b0f1f6
					
				
					 4 changed files with 16 additions and 15 deletions
				
			
		|  | @ -1,7 +1,8 @@ | |||
| import { TeacherInvitation } from '../entities/classes/teacher-invitation.entity.js'; | ||||
| import { mapToClassDTO } from './class.js'; | ||||
| import { mapToUserDTO, UserDTO } from './user.js'; | ||||
| import { mapToUserDTO } from './user.js'; | ||||
| import { ClassDTO } from 'dwengo-1-common/src/interfaces/class'; | ||||
| import { UserDTO } from 'dwengo-1-common/src/interfaces/user'; | ||||
| 
 | ||||
| export interface TeacherInvitationDTO { | ||||
|     sender: string | UserDTO; | ||||
|  |  | |||
|  | @ -1,17 +1,5 @@ | |||
| import { User } from '../entities/users/user.entity.js'; | ||||
| 
 | ||||
| export interface UserDTO { | ||||
|     id?: string; | ||||
|     username: string; | ||||
|     firstName: string; | ||||
|     lastName: string; | ||||
|     endpoints?: { | ||||
|         self: string; | ||||
|         classes: string; | ||||
|         questions: string; | ||||
|         invitations: string; | ||||
|     }; | ||||
| } | ||||
| import { UserDTO } from 'dwengo-1-common/src/interfaces/user'; | ||||
| 
 | ||||
| export function mapToUserDTO(user: User): UserDTO { | ||||
|     return { | ||||
|  |  | |||
							
								
								
									
										2
									
								
								common/src/interfaces/answer.d.ts
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								common/src/interfaces/answer.d.ts
									
										
									
									
										vendored
									
									
								
							|  | @ -1,5 +1,5 @@ | |||
| import { UserDTO } from 'dwengo-1-backend/src/interfaces/user.js'; | ||||
| import { QuestionDTO } from 'dwengo-1-backend/src/interfaces/question.js'; | ||||
| import { UserDTO } from './user'; | ||||
| 
 | ||||
| export interface AnswerDTO { | ||||
|     author: UserDTO; | ||||
|  |  | |||
							
								
								
									
										12
									
								
								common/src/interfaces/user.d.ts
									
										
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								common/src/interfaces/user.d.ts
									
										
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,12 @@ | |||
| export interface UserDTO { | ||||
|     id?: string; | ||||
|     username: string; | ||||
|     firstName: string; | ||||
|     lastName: string; | ||||
|     endpoints?: { | ||||
|         self: string; | ||||
|         classes: string; | ||||
|         questions: string; | ||||
|         invitations: string; | ||||
|     }; | ||||
| } | ||||
		Reference in a new issue