mirror of
				https://github.com/D4M13N-D3V/comissions-app-core-api.git
				synced 2025-10-31 09:35:25 +00:00 
			
		
		
		
	added update api call
This commit is contained in:
		
							parent
							
								
									eccf50004c
								
							
						
					
					
						commit
						db4aaee09b
					
				| @ -0,0 +1,26 @@ | |||||||
|  | using comissions.app.database; | ||||||
|  | using Microsoft.AspNetCore.Authorization; | ||||||
|  | using Microsoft.AspNetCore.Mvc; | ||||||
|  | using Microsoft.EntityFrameworkCore; | ||||||
|  | 
 | ||||||
|  | namespace comissions.app.api.Controllers; | ||||||
|  | 
 | ||||||
|  | [ApiController] | ||||||
|  | [Authorize("admin")] | ||||||
|  | [Route("api/admin/[controller]")]
 | ||||||
|  | public class AdminDatabaseController:ControllerBase | ||||||
|  | { | ||||||
|  |     private readonly ApplicationDbContext _dbContext; | ||||||
|  | 
 | ||||||
|  |     public AdminDatabaseController(ApplicationDbContext dbContext) | ||||||
|  |     { | ||||||
|  |         _dbContext = dbContext; | ||||||
|  |     } | ||||||
|  |      | ||||||
|  |     [HttpPatch] | ||||||
|  |     public async Task<IActionResult> UpdateDatabase() | ||||||
|  |     { | ||||||
|  |         await _dbContext.Database.MigrateAsync(); | ||||||
|  |         return Ok(); | ||||||
|  |     } | ||||||
|  | } | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Damien Ostler
						Damien Ostler