Ajax working as intended
This commit is contained in:
		
							
								
								
									
										3
									
								
								.idea/workspace.xml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										3
									
								
								.idea/workspace.xml
									
									
									
										generated
									
									
									
								
							| @@ -21,6 +21,7 @@ | |||||||
|   <component name="ChangeListManager"> |   <component name="ChangeListManager"> | ||||||
|     <list default="true" id="458cde88-df3d-44bc-9d57-a33823e2f1a6" name="Default Changelist" comment=""> |     <list default="true" id="458cde88-df3d-44bc-9d57-a33823e2f1a6" name="Default Changelist" comment=""> | ||||||
|       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> |       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> | ||||||
|  |       <change beforePath="$PROJECT_DIR$/src/main/resources/static/js/datatransfer.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/static/js/datatransfer.js" afterDir="false" /> | ||||||
|     </list> |     </list> | ||||||
|     <option name="SHOW_DIALOG" value="false" /> |     <option name="SHOW_DIALOG" value="false" /> | ||||||
|     <option name="HIGHLIGHT_CONFLICTS" value="true" /> |     <option name="HIGHLIGHT_CONFLICTS" value="true" /> | ||||||
| @@ -312,7 +313,7 @@ | |||||||
|       <workItem from="1612609113694" duration="13936000" /> |       <workItem from="1612609113694" duration="13936000" /> | ||||||
|       <workItem from="1612777983977" duration="14203000" /> |       <workItem from="1612777983977" duration="14203000" /> | ||||||
|       <workItem from="1612868404302" duration="13841000" /> |       <workItem from="1612868404302" duration="13841000" /> | ||||||
|       <workItem from="1613384221052" duration="4201000" /> |       <workItem from="1613384221052" duration="5569000" /> | ||||||
|     </task> |     </task> | ||||||
|     <task id="LOCAL-00077" summary="testing jenkins docker"> |     <task id="LOCAL-00077" summary="testing jenkins docker"> | ||||||
|       <created>1601453886631</created> |       <created>1601453886631</created> | ||||||
|   | |||||||
| @@ -49,37 +49,38 @@ function getCookie(cname) { | |||||||
|  |  | ||||||
| function updateData(){ | function updateData(){ | ||||||
|     var updatedJson = generateJson(); |     var updatedJson = generateJson(); | ||||||
|     $.ajax({ |     var request = $.ajax({ | ||||||
|         url: 'http://localhost:8097/mock/json', |         url: 'http://localhost:8097/mock/json', | ||||||
|         type: 'PUT', |         type: 'PUT', | ||||||
|         data: JSON.stringify(updatedJson, null, 2), |         data: JSON.stringify(updatedJson, null, 2), | ||||||
|         error: function(e) { |  | ||||||
|             console.log(e); |  | ||||||
|         }, |  | ||||||
|         dataType: "json", |         dataType: "json", | ||||||
|         contentType: "application/json", |         contentType: "application/json", | ||||||
|         success: getData(), |  | ||||||
|     }); |     }); | ||||||
|  |     request.done(function () { | ||||||
|         getData(); |         getData(); | ||||||
|  |     }); | ||||||
| } | } | ||||||
|  |  | ||||||
| function addMessage(){ | function addMessage(){ | ||||||
|     $.ajax({ |  | ||||||
|  |     var request = $.ajax({ | ||||||
|         url: 'http://localhost:8097/mock/json/'+clientUUID, |         url: 'http://localhost:8097/mock/json/'+clientUUID, | ||||||
|         type: 'POST', |         type: 'POST', | ||||||
|         success: getData(), |  | ||||||
|     }); |     }); | ||||||
|  |     request.done(function () { | ||||||
|         getData(); |         getData(); | ||||||
|  |     }); | ||||||
| } | } | ||||||
|  |  | ||||||
| function removeTile(id){ | function removeTile(id){ | ||||||
|     var jsonObject = findJsonById(id); |     var jsonObject = findJsonById(id); | ||||||
|     $.ajax({ |     var request = $.ajax({ | ||||||
|         url: 'http://localhost:8097/mock/json/'+clientUUID + '/' + id, |         url: 'http://localhost:8097/mock/json/'+clientUUID + '/' + id, | ||||||
|         type: 'DELETE', |         type: 'DELETE', | ||||||
|         success: getData(), |  | ||||||
|     }); |     }); | ||||||
|  |     request.done(function () { | ||||||
|         getData(); |         getData(); | ||||||
|  |     }); | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user