MDL-59384 core_calendar: add deleteEvent function to repository
Part of MDL-59333.
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
||||
define(["jquery","core/ajax"],function(a,b){var c=function(a){var c={methodname:"core_calendar_get_calendar_event_by_id",args:{eventid:a}};return b.call([c])[0]};return{getEventById:c}});
|
||||
define(["jquery","core/ajax"],function(a,b){var c=function(a){var c={methodname:"core_calendar_delete_calendar_events",args:{events:[{eventid:a,repeat:1}]}};return b.call([c])[0]},d=function(a){var c={methodname:"core_calendar_get_calendar_event_by_id",args:{eventid:a}};return b.call([c])[0]};return{getEventById:d,deleteEvent:c}});
|
||||
@@ -24,6 +24,27 @@
|
||||
*/
|
||||
define(['jquery', 'core/ajax'], function($, Ajax) {
|
||||
|
||||
/**
|
||||
* Delete a calendar event.
|
||||
*
|
||||
* @method deleteEvent
|
||||
* @param {int} eventId The event id.
|
||||
* @return {promise} Resolved with requested calendar event
|
||||
*/
|
||||
var deleteEvent = function(eventId) {
|
||||
|
||||
var request = {
|
||||
methodname: 'core_calendar_delete_calendar_events',
|
||||
args: {
|
||||
events: [{
|
||||
eventid: eventId,
|
||||
repeat: 1
|
||||
}]
|
||||
}
|
||||
};
|
||||
|
||||
return Ajax.call([request])[0];
|
||||
};
|
||||
|
||||
/**
|
||||
* Get a calendar event by id.
|
||||
@@ -45,6 +66,7 @@ define(['jquery', 'core/ajax'], function($, Ajax) {
|
||||
};
|
||||
|
||||
return {
|
||||
getEventById: getEventById
|
||||
getEventById: getEventById,
|
||||
deleteEvent: deleteEvent
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user