Edits history of script submission #22372 for ' Delete Event (gcal)'

  • bunnative
    One script reply has been approved by the moderators
    Ap­pro­ved
    //native
    
    type Gcal = {
      token: string;
    };
    export async function main(
      gcal_auth: Gcal,
      calendarId: string,
      eventId: string,
    ) {
      const sendUpdates = "all";
    
      const DELETE_EVENT_URL = `https://www.googleapis.com/calendar/v3/calendars/${calendarId}/events/${eventId}/?sendUpdates=${sendUpdates}`;
    
      const token = gcal_auth["token"];
    
      const response = await fetch(DELETE_EVENT_URL, {
        method: "DELETE",
        headers: {
          Authorization: "Bearer " + token,
          "Content-Type": "application/json",
        },
      });
    
      return response;
    }
    

    Submitted by hugo989 6 days ago