Fix upload json formatting
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
				
			Fix extraAttributes null exception
This commit is contained in:
		| @@ -154,7 +154,7 @@ export class ItemService { | |||||||
|  |  | ||||||
|   putItemFile(item: IItem, jsonObject: any): Observable<IItem> { |   putItemFile(item: IItem, jsonObject: any): Observable<IItem> { | ||||||
|     const formData = new FormData(); |     const formData = new FormData(); | ||||||
|     const file = new File([JSON.stringify(jsonObject)], 'data.dat', {type: 'application/json'}); |     const file = new File([JSON.stringify(jsonObject, undefined, '\t')], 'data.dat', {type: 'application/json'}); | ||||||
|     formData.append('file', file); |     formData.append('file', file); | ||||||
|     return this.httpClient.put<any>(`${this.ApiEndpoint()}/api/v1/items/${item.code}/data`, formData); |     return this.httpClient.put<any>(`${this.ApiEndpoint()}/api/v1/items/${item.code}/data`, formData); | ||||||
|   } |   } | ||||||
|   | |||||||
| @@ -27,7 +27,7 @@ export class ItemTypeService { | |||||||
|  |  | ||||||
|      getExtraAttributes(itemType: string) { |      getExtraAttributes(itemType: string) { | ||||||
|       let extraAttributes = null; |       let extraAttributes = null; | ||||||
|       if (this.itemTypes[itemType]) extraAttributes = this.itemTypes[itemType].extraAttributes; |       if (this.itemTypes[itemType] && this.itemTypes[itemType].extraAttributes) extraAttributes = this.itemTypes[itemType].extraAttributes; | ||||||
|       return extraAttributes; |       return extraAttributes; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user