Fix for submitWeeklyReport ts API
This commit is contained in:
		
							parent
							
								
									ec362cfa3a
								
							
						
					
					
						commit
						dbbe4da401
					
				
					 1 changed files with 4 additions and 4 deletions
				
			
		|  | @ -85,7 +85,7 @@ interface API { | |||
|   submitWeeklyReport( | ||||
|     weeklyReport: NewWeeklyReport, | ||||
|     token: string, | ||||
|   ): Promise<APIResponse<NewWeeklyReport>>; | ||||
|   ): Promise<APIResponse<string>>; | ||||
| 
 | ||||
|   /** Gets a weekly report for a specific user, project and week | ||||
|    * @param {string} projectName The name of the project. | ||||
|  | @ -294,7 +294,7 @@ export const api: API = { | |||
|   async submitWeeklyReport( | ||||
|     weeklyReport: NewWeeklyReport, | ||||
|     token: string, | ||||
|   ): Promise<APIResponse<NewWeeklyReport>> { | ||||
|   ): Promise<APIResponse<string>> { | ||||
|     try { | ||||
|       const response = await fetch("/api/submitWeeklyReport", { | ||||
|         method: "POST", | ||||
|  | @ -312,8 +312,8 @@ export const api: API = { | |||
|         }; | ||||
|       } | ||||
| 
 | ||||
|       const data = (await response.json()) as NewWeeklyReport; | ||||
|       return { success: true, data }; | ||||
|       const data = await response.text(); | ||||
|       return { success: true, message: data }; | ||||
|     } catch (e) { | ||||
|       return { | ||||
|         success: false, | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Imbus
						Imbus