mirror of
				https://github.com/grocy/grocy.git
				synced 2025-10-25 21:46:02 +00:00 
			
		
		
		
	Also return Userfields for Userobjects (endpoint /objects/{entity}) (fixes #979)
This commit is contained in:
		| @@ -73,6 +73,7 @@ | ||||
| - Performance improvements of the `/stock/products/*` endpoints (thanks @fipwmaqzufheoxq92ebc) | ||||
| - Fixed that the endpoint `/objects/{entity}/{objectId}` always returned successfully, even when the given object not exists (now returns `404` when the object is not found) (thanks @fipwmaqzufheoxq92ebc) | ||||
| - Fixed that the endpoint `/stock/volatile` didn't include products which expire today (thanks @fipwmaqzufheoxq92ebc) | ||||
| - Fixed that the endpoint `/objects/{entity}` did not include Userfields for Userentities (so the effective endpoint `/objects/userobjects`) | ||||
| - Fixed (again) that CORS was broken | ||||
|  | ||||
| ### General & other improvements/fixes | ||||
|   | ||||
							
								
								
									
										36
									
								
								migrations/0113.sql
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								migrations/0113.sql
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,36 @@ | ||||
| DROP VIEW userfield_values_resolved; | ||||
| CREATE VIEW userfield_values_resolved | ||||
| AS | ||||
| SELECT | ||||
| 	u.id, -- Dummy, LessQL needs an id column | ||||
| 	u.entity, | ||||
| 	u.name, | ||||
| 	u.caption, | ||||
| 	u.type, | ||||
| 	u.show_as_column_in_tables, | ||||
| 	u.row_created_timestamp, | ||||
| 	u.config, | ||||
| 	uv.object_id, | ||||
| 	uv.value | ||||
| FROM userfields u | ||||
| JOIN userfield_values uv | ||||
| 	ON u.id = uv.field_id | ||||
|  | ||||
| UNION | ||||
|  | ||||
| -- Kind of a hack, include userentity userfields also for the table userobjects | ||||
| SELECT | ||||
| 	u.id, -- Dummy, LessQL needs an id column, | ||||
| 	'userobjects', | ||||
| 	u.name, | ||||
| 	u.caption, | ||||
| 	u.type, | ||||
| 	u.show_as_column_in_tables, | ||||
| 	u.row_created_timestamp, | ||||
| 	u.config, | ||||
| 	uv.object_id, | ||||
| 	uv.value | ||||
| FROM userfields u | ||||
| JOIN userfield_values uv | ||||
| 	ON u.id = uv.field_id | ||||
| WHERE u.entity like 'userentity-%'; | ||||
		Reference in New Issue
	
	Block a user