Prechádzať zdrojové kódy

Refresh calendar after DnD actions

Vijayakrishnan 4 rokov pred
rodič
commit
59ea88fc6d

+ 10 - 1
resources/views/app/patient/appointment-calendar.blade.php

@@ -594,6 +594,7 @@
                                 ("0" + _dateTime.getMinutes()).slice(-2);
                         },
                         eventMovedOrResized: function (info) {
+                            let self = this;
                             if(!window.confirm('Are you sure?')) {
                                 this.refreshEvents();
                                 return;
@@ -611,7 +612,15 @@
                                 endTime: endTime,
                                 timeZone: this.timezone,
                             }, function(_data) {
-                                console.log(_data)
+                                self.refreshEvents();
+                                if(_data) {
+                                    if(!_data.success) {
+                                        toastr.error(_data.message);
+                                    }
+                                }
+                                else {
+                                    toastr.error('Unable to update the appointment!');
+                                }
                             }, 'json');
                         },
                         refreshEvents: function() {