mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-11-04 07:24:13 +00:00 
			
		
		
		
	Fix error response format
This commit is contained in:
		
							parent
							
								
									cc8a7dd588
								
							
						
					
					
						commit
						a44ac3306e
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -15,7 +15,7 @@ export default async (endpoint: IEndpoint, ctx: Koa.BaseContext) => {
 | 
			
		|||
			ctx.status = 204;
 | 
			
		||||
		} else if (typeof x === 'number') {
 | 
			
		||||
			ctx.status = x;
 | 
			
		||||
			ctx.body = y;
 | 
			
		||||
			ctx.body = { error: y };
 | 
			
		||||
		} else {
 | 
			
		||||
			ctx.body = x;
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue