Frontend API interface fixed (untested) for getWeeklyReportsForUser
This commit is contained in:
		
							parent
							
								
									649a4ba1fd
								
							
						
					
					
						commit
						d19372d66b
					
				
					 1 changed files with 9 additions and 2 deletions
				
			
		|  | @ -49,6 +49,14 @@ interface API { | |||
|     week: string, | ||||
|     token: string, | ||||
|   ): Promise<APIResponse<WeeklyReport>>; | ||||
|   /** | ||||
|    * Returns all the weekly reports for a user in a particular project | ||||
|    * The username is derived from the token | ||||
|    * | ||||
|    * @param {string} projectName The name of the project | ||||
|    * @param {string} token The token of the user | ||||
|    * @returns {APIResponse<WeeklyReport[]>} A list of weekly reports | ||||
|    */ | ||||
|   getWeeklyReportsForUser( | ||||
|     username: string, | ||||
|     projectName: string, | ||||
|  | @ -275,12 +283,11 @@ export const api: API = { | |||
|   }, | ||||
| 
 | ||||
|   async getWeeklyReportsForUser( | ||||
|     username: string, | ||||
|     projectName: string, | ||||
|     token: string, | ||||
|   ): Promise<APIResponse<WeeklyReport[]>> { | ||||
|     try { | ||||
|       const response = await fetch(`/api/getWeeklyReportsUser?username=${username}&projectName=${projectName}`, { | ||||
|       const response = await fetch(`/api/getWeeklyReportsUser/${projectName}`, { | ||||
|         method: "GET", | ||||
|         headers: { | ||||
|           "Content-Type": "application/json", | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Imbus
						Imbus